I was skeptical like you, but recently decided to try it out. I wasn't expecting much, and as such I was slightly surprised.
For example, just now my NAS stopped working because the boot device went offline. So I got to thinking about writing a simple syslog server. I've never looked at the syslog protocol before, and I've never done any low-level TCP/UDP work in C# yet.
So I asked ChatGPT to generate some code[1], and while the result is not perfect it's certainly better than nothing, and would save me time to get going.
As another example, a friend who's not very technical wanted to make an Arduino circuit to perform some automated experiment. He's dabbled with programing and can modify code, but struggles to get going. Again just for kicks, I asked ChatGPT and it provided a very nice starting point[2].
For exploratory stuff like this, it seems to provide a nice alternative to searching and piecing together the bits. Revolutionary is a quite loaded word, but it's certainly not just a slight improvement on what we had before LLMs and instead feels like a quantum leap.
This is what the AI is great at - the topics might be obscure to you but they are not that obscure in general, so the AI has had a lot of training data.
I've also assembled a Kubernetes cluster overnight, despite not knowing much about Kubernetes before, and I ran the kubectl files ChatGPT made for me past some devops folks, and it passed the smell test.
I consider much of coding to be a magic spellcasting tutorial - we do conceptually simple things, and the difficult lies in figuring out how to use novel libraries and get them to do what you want.
Edit: After checking out the Arduino sketch, I'd take issue with all the floating point calculations in there - most microcontrollers don't have FPUs, and the performance is awful on 8-bit AVRs. It's not great on Cortex M3s either as all this stuff is done in software, and each FP operation is like a hundred cycles.
I'd definitely try to rephrase the issue with integer math. It might work, but no self-respecting embedded dev would write like this.
> the topics might be obscure to you but they are not the obscure in general
Exactly, it's a very nice alternative to searching the web and discovering new stuff.
> most microcontrollers don't have FPUs, and the performance is awful on 8-bit AVRs.
I used to think like you. But then I realized the Atmega 328p is running at 16 MHz, so even hundreds of . As you can see here[1], it can do 94k double-precision FLOPS, more than enough for simple sketches like this. This jives with the benchmarks I did several years ago.
Sure if I was writing some tight control loop or similar I wouldn't use floating point.
Still it does not sit right with me - it might work, but figuring out the math with fixed point is not that hard, just requires some sitting down and thinking about it.
It's like I have some light fixtures in my attic that are connected with wires twisted together and covered with electrical tape - they certainly work and have done for a decade, but its still not right and I wouldn't recommend anyone do it this way.
Very interesting. A couple of notes here on the C# version.
Its using the old format where the Program.cs file has an actual class, whereas as of .NET 6 thats not required.
You said barebones, but for any real server you would want to use the generic host https://learn.microsoft.com/en-us/dotnet/core/extensions/gen... which gets you a lot of the boilerplate and enables you program to be wrapped in a windows or systemd service.
Finally, parsing can be simplified since ASCII is a proper subset of UTF-8, you can just parse the entire string as UTF-8. IMHO I am disappointed that the AI didn't point that out.
> You said barebones, but for any real server you would want to use the generic host
True, I intentionally said barebones as I wanted a minimal example. I asked it to modify the code to use the generic host, and updated the chat link (so refresh). Keep in mind this is the free ChatGPT, but I still think it did reasonably good. The example compiles as-is, and is very close to functional. I've not used the generic host stuff before either, so again this would save me time searching and piecing together code.
> Finally, parsing can be simplified since ASCII is a proper subset of UTF-8, you can just parse the entire string as UTF-8.
I don't think that would work, because the free-form text message part at the end must contain a BOM if it's UTF-8 encoded, according to the specification. AFAIK you can't have the BOM in the middle of a string.
I’m similar: LLM can improve my productivity by 10-20% when I’m working on something familiar, 30-50% when I’m venturing into a popular domain that I’m unfamiliar with.
I just don’t understand where the hell is this magical LLM capable of generating flawless files or even entire projects that many people are talking about. I rarely accept a large block of LLM-generated code without close inspection, and I’ve ended up with a subtle bug that I wouldn’t have written myself at least ~5 times now. Unless you don’t give a shit about code quality, error handling, proper logging, and subtle bugs, you shouldn’t run LLM-generated stuff without painstakingly reading and fixing everything. Or maybe there really is a magical LLM somewhere.
This is how i currently utilise and view The AI tools. I replaced the googling in my flow with it. It might have taken me 20minutes before to get the boilerplate together, now its a minute. Depending on the type of code legacy overheads you have, results may vary. If you can break your problem down into small descrete bits.
The way the OP here was talking about sonnet being above way above chatgtp in this case, it could be true. Google probably has the largest Go codebases on search to train the AI on higher quiality inputs. Go is a simpler language with less variation over time compared to something like .net also adding to its corner.
ive always been the type of person to use the right language for the each use case. For the last 10+ years ive primarly been building cross platform apps that target every common OS. So these "ai" tools like phind.com give me a universal API interface and generate code which is equiv to a SO answer. They are the ability of an outsourced junior dev who you would never let push code to prod, that doesnt have the language barrier but retains the fake dergee overheads ;)
For example, just now my NAS stopped working because the boot device went offline. So I got to thinking about writing a simple syslog server. I've never looked at the syslog protocol before, and I've never done any low-level TCP/UDP work in C# yet.
So I asked ChatGPT to generate some code[1], and while the result is not perfect it's certainly better than nothing, and would save me time to get going.
As another example, a friend who's not very technical wanted to make an Arduino circuit to perform some automated experiment. He's dabbled with programing and can modify code, but struggles to get going. Again just for kicks, I asked ChatGPT and it provided a very nice starting point[2].
For exploratory stuff like this, it seems to provide a nice alternative to searching and piecing together the bits. Revolutionary is a quite loaded word, but it's certainly not just a slight improvement on what we had before LLMs and instead feels like a quantum leap.
[1]: https://chatgpt.com/share/f4343939-74f1-404d-bfac-b903525f61... (modified, see reply)
[2]: https://chatgpt.com/share/fc764e73-f01f-4a7c-ab58-f43da3e077...