top | item 35382698

AI-enhanced development makes me more ambitious with my projects

702 points| duck | 3 years ago |simonwillison.net | reply

505 comments

order
[+] ThePhysicist|3 years ago|reply
What I really love is the unbounded optimism of the AI. How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?" that would then just think for a second and go "Certainly! Let's start by ...". These people exist, but they're one in a thousand (or million?). ChatGPT basically does that for almost every prompt you throw at it. So it really helps me overcome research barriers in software development in an incredibly short time, stuff that would've taken days or weeks to research can be done in literal minutes. And as I said before what's amazing is that the PoCs are really elegant and minimal, i.e. no superfluous code at all and condensed to the essence of the problem you're trying to solve.
[+] ihatepython|3 years ago|reply
> How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?

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!

[+] Robotbeat|3 years ago|reply
It reminds me of the boundless optimism of Mr Meeseeks: https://youtu.be/qUYvIAP3qQk

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.)

[+] withinboredom|3 years ago|reply
How do you know it is even close to correct? When I’ve asked it for code, it has been subtly wrong, or worse, correct but missing important edge cases that it doesn’t even seem to be aware of.
[+] ren_engineer|3 years ago|reply
Am I the only one that's been disappointed with GPT for coding? It's good at using common libraries and frameworks but for stuff using more niche libraries it fails miserably almost every time, to the extent that by the time I've debugged and written prompts to try and get it to do it properly I've spent more time than needed

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

[+] quaintdev|3 years ago|reply
I also love the fact that now I can develop on the go.

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.

[+] awb|3 years ago|reply
It’s taken some getting used to.

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

[+] PragmaticPulp|3 years ago|reply
> What I really love is the unbounded optimism of the AI. How many colleagues could you ask "Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?" that would then just think for a second and go "Certainly! Let's start by ..."

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.

[+] chasd00|3 years ago|reply
I've been putting it off and then finally signed up and started playing aroudn with chatgpt. I'm pretty amazed so far but i've only been asking it pretty easy stuff. "write a program that blinks an led on pin 13 in circuitpython", "write a rest api in Java using Spring" stuff like that. I wonder if people will start running to chatgpt for an algorithm instead of searching for a library for an implementation of said algorith.

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.

[+] mistercow|3 years ago|reply
I’ve actually found that ChatGPT 4 has some sense of realistic expectations about what it can accomplish in the context of a conversation. For example, I asked it to implement polygon triangulation supporting polygons with holes in it, and it was like “Whoa now, I can tell you all about ear clipping, but that’s too big and complex to implement here”.

ChatGPT 3.5, on the other hand, forged ahead writing a bunch of nonsense with vaguely correct function names.

[+] spyder|3 years ago|reply
Another trick I have found interesting and somewhat useful: asking it to give you his confidence score for it's statements, and a lot of the time his confidence are lower for his wrong statements but also lot of the times has high confidence in some wrong answers too (for example gets simple math wrong with 100% confidence), so not sure it's really that useful just an interesting thing to try.
[+] baq|3 years ago|reply
> Can you write me a PoC for a horizontally scalable, probabilistic database in Rust, using Raft-based consensus?

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.

[+] notahacker|3 years ago|reply
I've worked with people who say "Certainly, let's start by..." to absolutely everything regardless of whether they know how to solve it or merely wish to leave you with the impression they do, and much prefer working with people who have a scale of "Certainly, let's start by" to "you should probably ask someone else".

Even better if they have an "Are you sure this is a good idea?" mode, possibly even with suggested alternatives

[+] jeron|3 years ago|reply
everything seems easy when you're armed by the corpus of all human text
[+] danielvaughn|3 years ago|reply
This is an interesting point. I haven't felt this kind of optimism since...maybe way back when browsers were first becoming powerful? Like 2009-ish? Right around when I started, there was a huge amount of interest in how to leverage browser tech to make better app experiences.
[+] esalman|3 years ago|reply
I was never a graphics/3D designer but ChatGPT basically unlocked a potential new skillet for me.
[+] throwaway689236|3 years ago|reply
I also like the fact that you can ask it as many stupid question as you like, it's not bothered or irritated by it as a real person would be.
[+] raducu|3 years ago|reply
Yes, I suspect the AI finds all answers just as easy/hard. Whereas for humans certain programming tasks are orders of magnitude harder than others.
[+] intelVISA|3 years ago|reply
Most of mine would probably, correctly?, advise C++ and Paxos for that use case but each to their own!

Depends how jr your team is I suppose.

[+] utdiscant|3 years ago|reply
For the interested, this is the response by GPT4 given that prompt:

---

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.

[+] zamfi|3 years ago|reply
@Simon, I love this. And one day, in the not too distant future, a few old wizened graybeards, like you and I and the other folks on this site who have been writing code from scratch for 20 years, will be the magicians who walk the earth among mere mortals who only learned to code with the assistance of ChatGPT.

We will be the ones with the preattentive syntax parsing in our brains that let us simply see basic syntax errors; we will be the ones who can point out simple but subtle errors immediately—because we’ve made them 10000 times; we will be the ones who can take a ChatGPT response and immediately identify how it’s lacking not just in outcome but in edge case handling. We came of age before stack overflow, and have matured to the point where we treat stack overflow answers as mere suggestions for a possible approach, not as code to be copied and adapted.

And then, when we are no more, there will be no one left who can wrangle the turtles that reach the bottommost depths of the full stack.

[+] zer00eyz|3 years ago|reply
First of all chat GPT is great.

It is all the magic of early google, and stack overflow... Not as many ads less bullshit.

I have been coding for 25 years. Chat GPT + willing sr engineer means 2 less jr. dev's. I lived through the dot com bust, and now I can do a heroic amount of work with less effort.

This raises two points:

1. It's clear that we have too much grunt work. Im not sure if this is a failure of language design or libraries, but we need to do better at the core.

2. We continue to narrow the path to get experience as an engineer. This is great for companies in the near term (this looming down cycle), but bad for the industry as a whole long term (we dont have a pool of strong jr. engineers).

[+] tinyprojects|3 years ago|reply
100% this.

I just used GPT-4 to help build an analytics dashboard using ChartJS. There's so many settings in ChartJS, it would have taken me a week to StackOverflow / Google how to get my charts how I'd like them - it took me a day with GPT-4. I could just ask it anything and it would help no problem. Any buggy code it produced, I'd just copy and paste the error message and it would provide a fix.

The day before I built a basic version of Stripe Radar: https://news.ycombinator.com/item?id=35323278

Coding with AI has made me more excited to build than ever before after 10+years of programming.

[+] newtwilly|3 years ago|reply
What interface are you using? I've so far only used ChatGPT through the web interface. (I pay for plus). I just ask it for things that are standalone snippet-like things. Perfect functions on the standard library, or an emacs lisp snippet for converting a unix epoch to an ISO timestamp. I'm not sure I could allow it to read my company's code, but is that what you're doing when you're using as part of a large project like that?
[+] xxswagmasterxx|3 years ago|reply
Imo the chartjs docs are not very good. Or i'm just used to rust's docs.rs, where the whole api surface is documented. I couldn't find something like this for chartjs.
[+] manicennui|3 years ago|reply
How is it possible that any task could take a week or more with this library? It looks extremely straightforward and the documentation contains lots of examples.
[+] spookybones|3 years ago|reply
I’ve found that AI prompting has been nearly as time consuming as doing it myself from the get-go. This includes content writing and visual art. Maybe I’m an edge case. I’m not a skilled programmer. However, I’m a decent writer and painter. At most, it generates quick, solid, though generic ideas. Unfortunately, I have to do a lot of reverse engineering and curation to make any valuable changes. Try writing a tech article about, say, an iPad, and it will give you a lot of generic, but well-written content devoid of any tech specs. Add tech specs and use lose the style. What should be a simple fluff piece takes a couple of hours to get the balance right. Or try creating a visual work of, say, two people running down a street, holding hands, and unless you’re very open to interpretation, many hours later, you still won’t have anything approximating what you imagined. You change the “camera” angle, and they’re no longer holding hands. You add a small detail, and the entire scene morphs, etc. I’m saying this as someone who also uses weights and negative prompts. I look forward to further advances, though I’m perfectly happy if these skills remain in the realm of humans.

I will admit chatgpt and copilot are very good at offering up bite-sized pieces of code, like particular objects and functions as well as templates.

[+] TaylorAlexander|3 years ago|reply
I’ve not actually tried using it for writing help yet, though we’ve had a lot of interesting conversations. My thinking is that when I do some writing, I’ll give it my plan and then ask it for specific content or topic suggestions based on writers and philosophers I’m interested in, or other goals. Then I will write the piece myself, feed it to GPT-4, and ask it for feedback and advice. I’ll re-state my goals and ask it how I’m doing.

I absolutely would not expect it to fully write what I want, but I’ve found it very thoughtful for analysis so far in our conversations.

[+] still_grokking|3 years ago|reply
It's the exact same for code tasks. The AI is actually quite a waste of time…

You need to check every word of the AI for truth anyway, so you need to research all the stuff it tells you, as it could be made up, everything it tells you is very shallow, so you need to dig into the topics anyway, and making even small changed by the AI requires ridiculous amounts of explaining details in prose, instead of just changing a few lines by hand.

All in all it's much easier to come up with some more reasonable solution in a shorter time by just doing it the "classical" way: Read the docs and copy-paste code snippets from proper curated examples some human actually tested.

I don't say that an AI could not program at some point in the future. But I guess it would require AGI to be competitive with people who actually know what they're doing. But at the time we have AGI we have anyway much larger "problems" than how to write code, as more or less all human intellectual work would be superfluous.

[+] andreyk|3 years ago|reply
I've definitely found this to be the case with writing. ChatGPT gets you a "valid" output, but usually a bland and lame one. I think it's better for editing and brainstorming, or for simple tweaks. Specialized tools like SudoWrite are actually more useful as part of a writing work flow.

Pardon the plug, but I co-wrote a little blog post about this with concrete examples, if it is of interest: https://open.substack.com/pub/storiesbyai/p/chatgpt-for-crea...

[+] ashitlerferad|3 years ago|reply
Honestly, I keep secret some of the amazing uses of ChatGPT. I feel selfish but also I feel as if everyone is respsible for what they get out of it. We have many people and the media spending hours and tons of prompts trying to create funny or eyebrow raising headlines. I just keep my head down an marvel at the growing array if uses, many complex, that chatgpt can perform. It has been making me tons more money for just $20 a month. I could hire 10 developers and assistants and they would not be able to come close to it's technical, coding and general abilities and in 1 to 5% of the time it would usually take!
[+] GaggiX|3 years ago|reply
I agree, it also helps me to get things started, sometimes when I want to start a new project I need to learn new tools and/or APIs but the documentation can leave a lot to be desired, so the mental overhead could be too much that I get bored soon if I don't get results.

I have abused chatGPT so much that I have an impulse to talk to other programs that are not the chat bot, like the terminal and VS Code, when they give me an error that I cannot understand, just to ask them "why?", like a premonitory dream I think I have an idea how chat bot could be integrated into every piece of software sometimes in the future.

[+] grph123dot|3 years ago|reply
Yesterday I asked chatgpt to compute the probability that two words of five letters both began with the same three letters and it could not solve it. It gave me about 10 different results but all were wrong, it seems the number five mislead the algorithm. Another question was computing the variance of the sum of 60 dices but omitting the results where the sum was greater than 200, the reasoning was incorrect in all cases, finally I suggested creating a simulation to estimate the variance in R, but it made an error about the var command in R suggesting that it has an option for the degree of freedom.
[+] qwertox|3 years ago|reply
In my eyes ChatGPT is a blessing for developers.

The only thing I dislike about d3 is the boilerplate code to hook it up to a div and get the first lines to render, so yesterday I did a:

Assuming I have the following data: ```{ "status": "ok", "data": { "a": [[1680079200000, -199], [1680079800000, 92]], "b": [[1680079200000, 248], [1680079800000, 259]]] } }```, where the first item in the array is always the unix timestamp in ms, and the second one the value of the datapoint. Also assume that I have a website with an HTML element `<div id="graph"></div>`. Please show me the code used to draw a graph of "a" and "b" with d3 into the `div` element.

And it generated all the code I hated to "create".

Then little things like "Ok, I want the time not to be in AM PM, but in HH:MM" which used to mean to visit a couple of pages, the answer's right there.

I absolutely love it.

[+] jfvinueza|3 years ago|reply
Yes, agree. I mean GPT-4 is an all in all a fantastic tool, but it's especially good for developing. The moment you transform a blurry idea into structured data in any form (and it helps a lot with that: you can chat like two decent citizens and ask it to transform it to json at any given time), you can pretty much generate infinite boilerplate that's consistent through a whole application: interfaces > tables > migrations > models > forms > tests. But it goes way beyond crud, and during that iterative process you can come up with some sophisticated enhancement that you wouldn't have even entertained and all of a sudden it's easy to implement. It's great for longform code & structure generating conversations and it's great for picking up little details that would have taken the most of the afternoon. I'm in awe, really (as is everybody else?).

And yes, it does make mistakes, very rarely, and you can't really upload the whole source code everytime you want to talk with it, but it makes the programming dream real again (if only for a couple years lol): is not like you don't _type_; there's so many things you stop thinking about. And you can say: oh, there's the catch, but the truth is my own buffer is so much freer all the time, I get to tweak files, with excitement, that a couple months ago would have been very tedious to get a grasp of. And about code quality: its Elixir is alright, its Typescript is excellent, but it's absolutely flawless at concatenating unix commands: it has read all the man pages. I've aliased more custom commands these couple weeks than in the whole of last year, and my workflow is getting tighter and tighter each day. There's just so much power into this thing.

[+] skybrian|3 years ago|reply
I tried using ChatGPT a bit with the GPT4 model and it seems quite promising, but also very slow. When it's writing out the same function again with a change I asked for, it reminds me of the old days when connecting to a BBS with a 300 baud modem.

Am I doing it wrong somehow?

[+] asim|3 years ago|reply
Every generation faces this sort of issue which is learning skills for the current technology which then get displaced in 20-30 years. I think there's always a worry we're going to lose some knowledge in the process but equally the productivity gain seems to be 10x and it leads to dealing with higher level problems. Very few people are kernel hacking now as a percentage of the overall engineering community.

I guess the question is. What do we build with this form of engineering. It's so very early. We're using it as a way to augment current systems but I think we'll build for entirely new things soon.

[+] Technotroll|3 years ago|reply
Roughly 80% of the time, currently. Which is great! But if you don't keep that in mind, you risk making a fool of yourself.

It'll most likely improve in the future, I'm sure. The amount of real-world progress this will bring to humanity boggles the mind. I think we'll see progress in many and as-of-yet unthought of areas, because the power of mathematics, algorithms, and advanced systems will become available to a lot more people due to this "helpful uncle".

I do hope they work on improving its math skills though, also in the sense that it can explain the steps taken when solving equations or algorithms, or even how algorithms could perhaps be "translated" and implemented in various languages. In my opinion this is key to understanding mathematics, and a whole host of other systems as well. Moreover, it helps people who previously didn’t have the capacity to understand these things, so the effect on “world knowledge” is cumulative.

Personally, ChatGPT has been a great help for understanding many things a lot better, everything from mathematical equations to subsystems in Linux. And of course, it has helped me improve my coding.

[+] lysecret|3 years ago|reply
Id say it has approximate as high a chance to work as "random code from the internet". Also, it is often just relying on an old version of an API or a Library.
[+] phonebucket|3 years ago|reply
Two big hurdles for ML: a) explainability b) accountability.

ML-enhanced development neatly circumvents this: explainability and accountability is passed on to the developer. This includes bugs and license infringements.

I have no qualms about ML tools in development. But so long as the buck stops with me, I prefer to write from scratch.

[+] macrolime|3 years ago|reply
One of the things I've found is that at least with GPT-4, you can automate a lot of infrastructure. This can make it much easier to get started with new project where you need to set up various servers, containers, VMs etc. I haven't fully automated it yet, but I've done it enough manually through copy/paste between ChatGPT and the terminal to see it that would work if it was hooked up to langchain. You can create prompts to make it set up VMs, docker containers and then install and configure all kinds of software.

To make it work in most cases it should follow the same stuff as this implementation of a Reflexion agent for SOTA Human-Eval Python results, but use it for infrastructure. GPT-4 can generally figure out how to create tests from the documentation that will make it know when the task it finished correctly.

https://github.com/GammaTauAI/reflexion-human-eval

[+] PaulHoule|3 years ago|reply
Upwards of 80% of the effort in commercial software development is maintenance.

You could speed up the remainder dramatically and make very little progress on the rate progress happens and have people scratching their heads about why.

[+] miraantabrez|3 years ago|reply
ChatGPT is great when the time consuming bit is googling the details of libraries, APIs, languages, algorithms, etc, and wiring them together in the right way for a small bit of functionality or some boilerplate. But when the time consuming bit is thinking about the best way to solve a problem / introduce new abstractions in the context of a larger system, it seems less useful. Maybe this will improve with the context size.
[+] b33j0r|3 years ago|reply
I am using it in exactly the same way. I have access to ideas and code that I never would have tried before.

These other well-documented experiences that sound super perfect don’t match mine, though I’m a fan! Here’s how it goes for me.

I am a premium user and all, but it still bails on me every single time it’s going well, by writing half of a function or saying “network error”, then losing context.

I have to say “you stopped generating that last part, please continue and don’t bother qualifying.” Then it wastes more tokens apologizing anyway.

Whoever trained these models to apologize and say “as a large language model, I can’t promise that I know how Bjarne Stroustrup would refactor that bitshift, and yada yada” really wasted a lot of our productivity. And saved no one from any dangers of AI.

[+] mordymoop|3 years ago|reply
I can definitely relate to your experience. Just last week, I leveraged AI tools to develop some data processing code. Estimating how long it would have taken me to write that code without these tools is a challenge because, to be honest, a year ago I wouldn't have even considered attempting such a project. It might have required a week or even two of my time, which I simply cannot spare for this kind of undertaking. In the absence of these powerful AI tools, I would have opted for a more manual approach, like analyzing the data using Excel. It's fascinating to witness the impact AI has on our productivity and the expansion of possibilities it brings.
[+] newshorts|3 years ago|reply
I’m kind of excited now.

I used to build random weird things all the time (mostly centered around connecting physical devices up to the internet to accomplish something silly) - but lost my mojo once I had kids and didn’t the ability to pull all nighters to “hack” something together.

Now I feel like the barrier might be low enough that I could create again. Will have to try this out and see how it goes.