this post was submitted on 21 Oct 2024
399 points (96.5% liked)
Programmer Humor
32472 readers
467 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I haven't been in development for nearly 20 years now, but I assumed it worked like that:
You generate unit tests for a very specific function of rather limited magnitude, then you let AI generate the function. How could this work otherwise?
Bonus points if you let the AI divide your overall problem into smaller problems of manageable magnitudes. That wouldn't involve code generation as such...
Am I wrong with this approach?
The complexity here lies in having to craft a comprehensive enough spec. Correctness is one aspect, but another is performance. If the AI craps out code that passes your tests, but does it in really inefficient way then it's still a problem.
Also worth noting that you don't actually need AI to do such things. For example, Barliman is a tool that can do program synthesis. Given a set of tests to pass, it attempts to complete the program for you. Synthesis is performed using logic programming. Not only is it capable of generating code, but it can also reuse code it's already come up with as basis for solving bigger problems.
https://github.com/webyrd/Barliman
here's a talk about how it works https://www.youtube.com/watch?v=er_lLvkklsk
So it's like AI, but tailored for one purpose and without the marketing
also doesn't require burning down a rain forest each time you run a query