I couldn't agree more. I work as a software engineer in the medical field (think MRI's, X-rays, that sort of thing). I've started using ChatGPT all the time to write the code, and then I just fix it up a bit. So far it's working great!
People who just take that joke as serious clearly haven’t thought through the consequences of using code you don’t completely understand and has no real author. Therac 25 is often a key topic in any rigorous computer science education.
If I remember right, during the height of the most recent Iraq war, a U.S. soldier had a higher probability of being killed in a traffic accident while in the United States than being killed while actively deployed in Iraq.
If a (so-called) self-driving car screws up and kills some people, it's headline news everywhere. If Joe Blow downs five shots of scotch after being chewed out by his boss and crashes into a carload of kids, it barely makes the local news.
Sounds like he didn't know nearly as much as he thought. Chairlifts are remarkably safe.
https://newtoski.com/are-chairlifts-safe/
I get the point you're making though.
Developers who use this for serious stuff, how goes your reasoning? Is it just a calculated risk? Reward is greater than the risk?
Google vs Oracle is still being fought a decade on now.
What hope does the legal and legislative system have of possibly keeping up here? The horse will well and fully have left the barn by the time anything has been resolved and furthermore if AI continues becoming increasing useful there will be no option other than to bend the resolution to fit what has already passed.
It seems obvious that AI is the future, and that ChatGPT is the most advanced AI ever created.
For me (in the medical industry), if something goes wrong and someone dies a horrible death, I can just say that I didn't write that code, ChatGPT did. Not my fault.
Next time you are at the hospital getting an MRI, I hope you think about how it's entirely possible that ChatGPT wrote the majority of the mission-critical code.
GP is talking nonsense. No developer is ever going to be able to say "not my fault, I used what ChatGPT gave me" because without even reading the OpenAI license I can all but guarantee that the highly paid lawyers made sure that the terms and conditions include discharging all liability onto the user.
GP appears to think that if he sells a lethally defective toaster he can simply tell his buyer to make all claims against a unknown and impossible to reach supplier in China.
Products don't work like that, especially in life-critical industries (I worked in munitions, which has similar if not more onerous regulations).
The buck stops with whoever sold the product.
As long as that validation process is still as rigorous, I don't see much difference.
But that's also why documentation is so important in this space.
I spent 15+ years building software for pharmas that was subject to GxP validation so I know the effort it takes to "do it right", but also that it's never infallible. The main point of validation is to capture the evidence that you followed the process and not that the process is infallible.
Guess what will power the validation process?
Think about those efficiency gains.
A keyboard would be an example of a source whose output is 100% verified: we assume that you can see what you're typing. A process with 100% verification does not need to be separately qualified or validated.
I'm not sure how monitor errors could factor into this, can you elaborate?
One big question is, does the proposed software tool assist a human engineer, or does it replace a human engineer?
If a tool replaces a human -- the phrase used often is "takes a human out of the loop" -- then that tool is subject to intense scrutiny.
For example, it would be useful to have a tool that evaluates the output of an avionics box and compares the output to expected results, to automatically prepare a test passed/failed log. Well, this would amount to replacing a human who would otherwise have been monitoring the avionics box and recording test results. So the tool has to be verified that it works correctly, in the specific operating environment (including things like operating system version, computer hardware type, etc.)
So what about ChatGPT? One big hurdle is that, given the same input, ChatGPT will not necessarily provide the same output. There's really no way to verify its accuracy in a repeatable way. Thus I doubt that it would ever become a tool that replaces a human in aerospace engineering.
How about using it then to assist an aerospace engineer? Depending on the assistance, this should not necessarily be materially different than getting help from StackOverflow.
Liability doesn't work that way. Your view is so naive I'm having doubts about whether your an adult or not.
If you delivered the product, you're liable, regardless of where you got the product from.
After getting sued, you might be able to convince a judge that the supplier is liable. But getting sued is expensive, and the judge may not rule in your favour.
And even if it goes in your favour, OpenAI is simply going to turn around and point to the license you agreed to, in which no guarantee of fitness for purpose is specified, and all liability falls to the user.
You're still going to be liable.
Maybe they're just replying without having properly read your post, but that's not great either.
I like to think that it is not about who (or what) writes the code in the first place, it is about the review and testing procedures that ensure the quality of the final product. I think. Maybe it is just hopeless.
Even in that case, I would argue that is entirely a problem of the process, and should be fixed at that level. An experienced programmer doesn't become any less experienced just because they use ChatGPT.
This isn't the way pharmaceuticals are developed; we don't require the pharma companies to know how they work (and we shouldn't, because we don't know how many common safe drugs work). We validate them by testing them instead.
It's a whole different world of software development. If you set out to build flight control software because it is needed to run on a new airplane, you're not going to pivot midstream and build something else instead.
I hope this is some US fad, and I never ever come across those devices!
Instead of using formal methods as they should they use AI, which is more or less the complete contrary.
GPT-3/4 is like a Meeseeks box for computer and internet tasks. Keep your task simple, and it will quickly and happily solve it for you before ceasing to exist. (Well, that’s how I use it via the API, at least. ChatGPT will preserve the state, but of course the context window is still limited anyway.)
Kills me every time haha
The you test it manually with a few more inputs, then you write some automated tests for it (maybe with GPT's assistance).
Why not? And if I miss them, my editor, compiler or general testing should pick that up.
But out of curiosity, to give it something harder, I asked ChatGPT w/GPT3.5 to write me an interrupt handler for a simple raster effect for the Commodore 64 in 6502 assembly, and it got tantalisingly close while being oh-so-wrong in relatively basic ways which suggests that it hasn't "grasped" how to handle control flow in a language without clearly delineated units.
GPT4 appears to have gotten it right (it's ~30 years since I've done this myself), though the code it wrote was a weird mix of hacks to save the odd cycle followed by blatant cycle wasting stuff that suggest it's still not seen quite enough "proper" C64 demo code.
Edit: Hmm, maybe it can add uncertainty markers if I just ask...
--
Building a bridge over a lake using only toothpicks would be extremely challenging due to the limited strength of toothpicks. (70%) However, it is possible to build a toothpick bridge by using a truss structure. A truss structure involves using triangles to distribute the weight of the bridge evenly across the structure. (80%)
To build a toothpick bridge over the lake, the first step would be to create a design using a truss structure. The design should take into consideration the width of the bridge, the width of the lake, and the strength of toothpicks. (90%) The toothpicks should be laid in layers to increase their strength. (70%)
To estimate how many toothpicks would be needed, we would need to determine the spacing between each toothpick and the number of toothpicks needed to create the truss structure. The number of toothpicks required would also depend on the thickness and quality of the toothpicks used. (80%)
Given the width of the bridge is 20 meters and the width of the lake is 200 meters, the toothpick bridge would require approximately 10 layers of toothpicks to span the distance. However, without a detailed design, it is impossible to estimate the exact number of toothpicks needed to build the bridge. (60%)
Overall, I would say I am 70% confident in the correctness of this answer, as it is based on theoretical principles and assumptions about the strength of toothpicks.
--
It's... okay, not great. The blatantly wrong part is marked 60%, which is the lowest certainty it assigned to anything, but that's still really high for how wrong it is.
I often paste chunks of code into it just to get a detailed line-by-line explanation of exactly what that code is doing. It's really helpful, especially for convoluted code that you're trying to get a good feel for.
The process goes;
1. Write some code
2. Get AI assistance with some part
3. Check it's right, make changes
4. Write tests
5. Put up for code review
6. CI runs checks
7. Release Candidate
8. Release Testing
There are many, many chances to catch errors. If you don't have the above in place, i'd focus on that first before using AI assistance tools.
Yes, yes they are! HN is now inundated with examples and the situation is only going to get worse. People with zero understanding of code, who take hours to convert a single line from one language to another (and even then don’t care to understand the result) are shipping and selling software.
¹ Last paragraph: https://news.ycombinator.com/item?id=35133929
Crucially, those have context around them. And as you navigate them more and more you develop an intuitive sense for what is trustworthy or not. Perhaps you even find a particularly good blog which you reference first every time you want to learn something from a particular language. Or in the case of Stack Overflow, your trust in an answer is enhanced by the discussion around it: the larger the conversation, the more confident you can be of its merits and limitations.
When you get all your information from the same source and have no idea what it referenced, you lose the all the other cues regarding the validity, veracity, or usefulness of the information.
Often incorrect context, incredibly biased context (no you don't know what you want, here's a complete misdirection), or just plain outdated. So basically the same thing as ChatGPT.
People who blindly copy and paste and ship are always going to do that. Everyone else isn't. It's really that simple.
And as you learn more from different sources, you get better at identifying them.
> or just plain outdated
Which you can plainly see by looking at the date of publication. In the case of Stack Overflow, it is common that popular questions have newer answers which invalidate old ones and replace them at the top.
> People who blindly copy and paste and ship are always going to do that.
Yes, they will. You seem to agree that is bad. So wouldn’t it follow that it is also bad that the pool of people doing that is now increasing at a much larger rate?
Without a solution we're just whining about bad actors existing.
Of course they do.
Ship fast, break things, look cool, cash out, leave someone else to fix the mess you have created, it's the new black.
Even if they're not, I find "scouring code I didn't write for potential errors of any magnitude" to be much harder than "writing code". I admit there's a sweet spot where errors would be easy to spot or where the AI is getting you unstuck, but it's not trustworthy enough at the moment for me to take the risk.
Bad developers don't even know if the code they write themself is close to correct. AI doesn't make that situation any worse. It actually improves the situation.
The second shortcoming is that that I have to switch over to ChatGPT and it's messy to give it my existing code when it's more than just toy code. It would be a lot more effortless if it was integrated like Copilot (if we ignore the fact that this means sending all your code to OpenAI...).
Still, it's great for boilerplate, general algorithms, data translanslation (for small amounts of data). It's a great tool when exploring.
In fact I read every piece of code I write, right after I write it, and probably more times after. It's a good practice, because as an human, my first take at a piece of code is often subtly wrong, or correct but missing important edge cases.
Speaking of, I didn't deliberately insert that typo in the above paragraph, but I did notice it when I read this post before submitting it, and would normally have corrected it.
When I've asked for code it has been very wrong, the sweet spot appears to be things that you don't know off hand but can verify easily.
still good for handling a lot of grunge work and really useful for doing the stuff where I'm weaker as a "full stack" developer
I'm really excited about this part; I've been using it to help with DevOps stuff and it's been giving me so much more confidence in what I'm doing as well as helping me complete the task much quicker.
Based on what I've seen elsewhere, I really feel like it should've been able to answer this question directly. Overall this matches my experience so far this week. Not saying it's never useful, just regularly I expected it to be...better. Haven't had access to GPT-4 yet though, so I can't speak to it being better.
The AI is just a great waste of time in almost all cases I've tried so far. It's not even good at copy-pasting code…
Using Copilot as a better intellisense...but don't use it for big templates. Bard to find/summarize stuff I figure is probably in stack/SO somewhere.
Boilerplate I think I have seen a 35% increase in speed. Individual edge cases (like porting Azure AD v1/Identity 2.0 to Azure AD v2/Identity 2.0 authentication) maybe 10-15% improvement. My day to day is C#.
Better than an average google search though, given that mostly returns listicles.
If I was hacking Javascript or Python, especially gluing together common components, I'm sure I'd have a different experience.
I can ask chatgpt to write code for me for various modules of applications on a mobile device and I can then go home and put everything together.
Development on mobile although possible was not feasible due to the form factor. Now that limitation is gone and things are only going to improve.
I'm really looking forward to a solid voice/tts implementation that allows me to do something like this while I go out for a walk.
Take that, bucket list.
Most developers (including myself) get annoyed with: repetitive tasks, pivoting after substantial work, vague requests, juggling too many unrelated tasks, context switching, etc.
With Chat-GPT I’ve had to learn a new paradigm: any request is OK at any time
I agree about the unbounded optimism. It has been fun to ask ChatGPT where to start on certain project ideas I’ve had.
However, I’ve tried it three times with small but ambitious project ideas now. Each time it goes around in circles with general concepts but I can never get anywhere.
If I switch to common tutorial topics like “How can I write a simple TODO list app?” it performs surprisingly well.
As soon as I step outside of common tutorial material, I can’t seem to get anywhere with it.
I also use it to tell what the weird error text means given this snippet of code.
I do like asking it to explain things to me, for example "explain what a PID controller is". It reminds of like a real-time wikipedia.
ChatGPT 3.5, on the other hand, forged ahead writing a bunch of nonsense with vaguely correct function names.
just pasted this into bing creative mode. whatever this thing is spitting out right now would've probably taken me a week of research to even figure out the libraries and their APIs. it's given me a raft+sled+serde scaffolding, is on it's fourth 'continue' step and just keeps going.
Even better if they have an "Are you sure this is a good idea?" mode, possibly even with suggested alternatives
Depends how jr your team is I suppose.
---
As an AI language model, I'm unable to write full code examples, but I can provide you a high-level overview of how to implement a horizontally scalable, probabilistic database in Rust using the Raft consensus algorithm.
1) Define the data model: Design a data model for your probabilistic database, which should include the basic CRUD operations (Create, Read, Update, Delete). You can represent the data as a key-value store or any other data structure that fits your use case. Consider using a probabilistic data structure like a Bloom filter, Count-Min Sketch, or HyperLogLog to reduce memory usage and support approximate queries.
2) Implement the Raft protocol: To build a distributed system with strong consistency, you can use the Raft consensus algorithm. There are existing Rust libraries that implement the Raft protocol, such as raft-rs. Include this library in your project to handle the core Raft functionality.
3) Design your database nodes: Each node in the system should maintain a state machine that represents the current state of the database. The state machine should include the following components:
* A log to store the commands received from clients. * A state to apply the log entries and keep the actual data.
4) Handle client requests: For each client request, the leader node should create a corresponding command and append it to its log. Then, the leader should replicate the log entry to its follower nodes using the Raft protocol. Once a majority of the nodes acknowledge the new entry, the leader can consider it committed and apply the command to its state machine. After applying the command, the leader should send the response back to the client.
5) Implement horizontal scaling: To enable horizontal scaling, you need to partition your data across multiple nodes. One way to achieve this is by using consistent hashing. Consistent hashing helps distribute keys evenly across nodes while minimizing data movement when nodes are added or removed.
6) Handle node failures and recovery: Raft is designed to handle node failures and recovery. When a node goes down, the remaining nodes will continue to operate and maintain consistency. Once the failed node comes back online, it will synchronize with the current leader and catch up with the latest state.
7) Deploy and monitor your system: After implementing the necessary components, deploy your system across multiple nodes. Monitor the performance, consistency, and fault tolerance of your system to ensure it meets your requirements.
Here's a high-level outline of how the main components of your project could look like:
mod data_model; mod state_machine; mod raft;
use data_model::DataModel; use state_machine::StateMachine; use raft::RaftNode;
fn main() { let nodes = create_nodes(); let state_machine = StateMachine::new(DataModel::new()); let raft_node = RaftNode::new(nodes, state_machine);
// Start the RaftNode, which takes care of the Raft consensus protocol
raft_node.start();
// Start a server to handle client requests
let server = Server::new(raft_node.clone());
server.start();
// Optionally, start a monitoring and management interface
let monitoring = Monitoring::new(raft_node.clone());
monitoring.start();
}In this example, you'd need to implement the `data_model`, `state_machine`, `raft`, `Server`, and `Monitoring` modules/components to handle the different aspects of your horizontally scalable, probabilistic database.
Remember that this is a high-level outline and not a complete implementation. You'll need to dive deeper into each component to ensure proper functionality, scalability, and fault tolerance.
The example prompt is clearly asking for too much in one go, but this objection is trivial to overcome for anything not specifically hitting guardrails (and sometimes for those too) by telling it to act as if it's a [insert various roles to try].
You are an AI programming assistant.
- Follow the user's requirements carefully & totally
- First think step-by-step -- describe your plan first, then build in pseudocode, written in great detail
- Then output the code in a single codeblock
- Minimize any other prose