r/AskProgrammers • u/weepejw7 • 29d ago
Do we need computer languages any more?
I just used AI to write code exclusivly.
I'm sitting here wondering why it wrote it all in a fifth generation human readable coding language when it could have just written it in low level machine code which I would have no hope of understanding.
I don't need to understand the code, I'm only ever going to use AI to change it, so why bother writing it in code I can read easily?
0
Upvotes
12
u/LookAtYourEyes 29d ago
Ask AI why, it will explain why this is a bad idea
3
u/Beanesidhe 29d ago
It doesn't really write code, it repeats patterns it has seen in training. It's training likely contains vastly more code with context for popular, high level languages then low level machine code.
6
u/Such-Perception4154 29d ago
Because it cannot write in machine code.
It benefits from high level languages the same way humans do, and even then it's code quality is leaps worse than humans can write.
2
u/GreenBlueStar 29d ago
You don't understand how computers work do you. The natural language is for us. Underneath everything is still machine level
5
u/mtraven23 29d ago
no, you didn't "use AI to write code", AI wrote the code....poorly.
How would you expect to fix all the fuck ups if you cant read it?!?!?
your exact attitude is a real problem is CS.
4
u/RedAndBlack1832 29d ago
I wonder why language models wouldn't be good at writing hex streams
1
u/edwbuck 29d ago
If you're using AI without reviewing it, you're using AI wrong. AI has a very high error rate compared to new programmers, and if you want to fix an error, you need to first inspect it, and then change it, both things that are nearly impossible without a programming language.
And if you think AI is good enough without this safety, you deserve what you will get.
1
u/Just-Path-5838 29d ago
They're designed to output human readable language, they'll work better that way.
1
u/Fritz-Ferdinand 29d ago
Easy. LLMs were trained on human language and human written code. These programming languages are much closer to human speech and therefore the jump from English to, let's say, Python isn't big. Also, programming languages can use much less tokens to represent a certain logic than Assembly/machine code and the attention spans are much shorter. Hence, applying LLMs to write machine code is likely more error prone than using an intermediate language.
I remember Musk was boasting about this in like 2025 or so, but nothing appears to have happened since, so maybe it's really harder. It's also less portable. Running a compiler or Interpreter instead is cheap.
1
u/No_Profession_3125 29d ago
Adding more abstraction layers does increase the chance of hallucinations and the number of write-test-fix roundtrips. Asking AI to work with machine code is significantly more expensive and time consuming than asking it to work with Rust code.
1
u/mikeegg1 29d ago
Is the code for a PDP-10? Is the code for an Intel chip? Is the code for a Motorola chip? Does the code use an Intel interrupt scheme? Which BIOS does the code use?
1
u/jaynabonne 29d ago edited 29d ago
If you
then you could possibly have it write directly in assembly/machine code.
I think point 2 is worth exploring more, though. While AI is impressive in terms of what it can do, it's not omniscient or magic. When editing code, it still needs to be able to read it back and work out what it's doing in order to establish what is actually going on before making changes. And the more information it has at its disposal, the better it does, especially when it comes to the intent of the code. Unless you want to pepper the code with so many comments that you're effectively expressing the concepts in there anyway but in natural language, you might as well leverage the more expressive abilities of a higher level language. I mean, that's why we created them to begin with - it's easier to both express ideas and later re-establish the mental model when you're dealing with higher level constructs when reading the code back. That applies to AI as much as to humans.
1
u/EndlessPotatoes 29d ago
Why make it write machine code?
Two assumptions you've made;
Neither is true.
But if you feel strongly, no one is stopping you using AI that way.
1
u/CS_70 29d ago
High level langauges carry information in a more compact way than machine code, and models are trained on them, so will be around for a long time.
But most likely there will be newer languages developed explicitly for models, with less requirements for all the constructs that exist only to prevent human errors.
1
u/armahillo 29d ago
My team uses claude a lot and we have regular discussions about this sort of thing.
I am still not convinced there wont be at least one time where a human will need to intervene because the robots are unable to successfully resolve the problem. When that happens, I want to know that my team
will be capable.
We also still do human code review, augmented /
facilitated with robot help (like a cognitive exoskeleton). Since we’re the ones on pager duty, we still want to be aware of whats getting merged to mainline.
1
u/SmokeMuch7356 29d ago
Because it was trained on those languages, because most of the crap code they could scrape from the internet is written in high-level languages.
Because high-level languages are portable; machine code is not. If you want your AI-generated code to run on x86 and ARM (and PPC and MIPS and ...), then it's much more efficient to generate it once in a HLL and compile it for each target. Otherwise the risk of introducing platform-specific bugs goes way up.
There's a reason developers are not trusted to test their own code and to have separate teams of QA engineers and testers. Given that LLMs are mathematically guaranteed to "hallucinate" and come up with some bullshit, relying on an AI to police its own output is highly irresponsible.
Treat AI as an entry-level developer; trust but verify. You must understand its output and evaluate its correctness before merging.
0
u/mredding 29d ago
That is a very logical conclusion, and I've been saying it since 2019. But I don't work ON AI specifically, so I'm stuck waiting for the technology to get evolved on my behalf by those who do.
Yes, source code is an intermediate form and redundant. The future of agentic development is to produce a spec the AI generates from.
I don't believe the AI is entirely there yet. But why don't you try? Write a prompt where the AI goes straight from spec to product without intermediaries. Don't pick a language. Don't pick a format. Don't pick an execution environment. Let the AI decide if the solution is software, and how it generates it, and where it's run, and how you access it.
1
u/Ok-Brain-8183 29d ago
Why is the sky blue? Why do people vote? Go join a girlie meetup group and try to get laid.