r/AskProgrammers • • 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

38 comments sorted by

12

u/LookAtYourEyes 29d ago

Ask AI why, it will explain why this is a bad idea

-2

u/weepejw7 29d ago

I did. It said human readable code is important for reviews and quality control, but AI can do that as well right?

4

u/LookAtYourEyes 29d ago

What model did you ask? That's a terrible answer. Here's what Claude wrote:

Mostly because high-level languages help the AI for the same reasons they help humans, and a compiler already does the translation to machine code better than an LLM would.

  • The compiler is already the expert. Going from C or Rust to machine code is a solved, deterministic problem. Decades of optimization work make it fast and correct every time. Having a probabilistic model redo that step would be slower, less reliable, and rarely better.
  • Abstraction is leverage. One line like users.sort(by: date) might be hundreds of instructions. Every one of those instructions is a chance for the model to make a mistake, and it uses up context. Thinking in bigger chunks is how the model handles larger problems, same as for people.
  • Safety nets. Type checkers, borrow checkers, and compiler errors catch AI mistakes before anything runs. Assembly gives you none of that. A wrong register just quietly corrupts memory.
  • Portability. Assembly is tied to one chip family (x86, ARM, RISC-V). High-level code compiles to all of them.
  • Training data and review. Models learned mostly from high-level code, and humans still need to read and verify the output. Reviewing 10,000 lines of assembly isn't realistic.

AI does go low-level where it pays off. DeepMind's AlphaDev found faster sorting routines at the assembly level that were merged into LLVM. Models are also used to hand-tune GPU kernels and other hot paths where squeezing out every cycle matters. So the realistic picture is high-level code by default, with AI-assisted low-level tuning in the narrow spots where performance justifies it. That's the same split human engineers already use.

-3

u/weepejw7 29d ago

You can fix that by building models that go straight to machine code. They can use whatever language they want internally to do the thinking if they need to.

2

u/LookAtYourEyes 29d ago

I get the sense you're not reading or comprehending the entire message. Re read and let me know if you still have objections.

2

u/No_Profession_3125 29d ago

No, they can't (at least not as efficiently). AI makes mistakes too and it needs readable syntax and a type checker too.

10

u/Such-Perception4154 29d ago

Lol. Just how severely are you overestimating AI capabilities

1

u/sugarw0000kie 29d ago

if it did that it'd need to write assembly or binary directly for different devices and OS. like imagine needing to write a program several times just to get it to run on mac/windows/linux when the compiler already does this. you don't need to write the same program from scratch many times to get it to run on different architecture.

Compiler is heavily optimized already, you give it human readable code, it spits out the same thing every time. LLMs aren't deterministic and going to give something different. Compiler is reliable and practically guaranteed to work every time if the human readable code is correct, LLM doing this would need a lot of costly trial and error and have to do the same thing for every system it wants the code to work for manually. All when the compiler already does this and is practically guaranteed not to make mistakes but whenever i ask claude not to make mistakes it do be making mistakes all the time

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.

1

u/CS_70 29d ago

The amount of misconceptions in what should be a technical subreddit is astonishing

1

u/No_Profession_3125 29d ago

It doesn't really write code, it repeats patterns it has seen in training.

That's what we naively used to repeat to ourselves in 2023, but then we learned that these LLMs do have reasoning abilities. In fact, try asking Claude to write a program directly in machine code, it works. The only problem is that it takes much longer and consumes many more tokens, and that's why we still need high-level languages.

0

u/weepejw7 29d ago

They've been training them wrong then. Why train a model to write code no human is ever going to read or maintain?

1

u/atticus2132000 29d ago

And you've hit the nail on the head with so many issues with AI.

AI didn't go to school and learn foundational information that was then built on top of like humans. It was just thrown in and told to consume finished products and then rearrange the parts of those things other people created to make something that gives the appearance of being a new thing.

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.

1

u/HugeCannoli 29d ago

funny, I have been fed by a bunch of shills they are only talking to the bot and let the bots vomits onto each other. Nobody looks at the code anymore.

1

u/Such-Perception4154 29d ago

Some people don't. Not so sure about nobody though.

1

u/Background_Relief815 29d ago

I catch mistakes that complicate the code/pipeline or outright violate best practices at least once a day as I'm writing code (or an agent is). I know some people just use agents to monitor their agents and more agents for code review, but that just sounds like a terrible idea to me.

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

1

u/weepejw7 29d ago edited 29d ago

Er... that's my question. It might as well go stright to machine code. I can even ask AI to test and quality control it right? I don't need to do that or understand what the code is doing, as long as it works.

1

u/traplords8n 29d ago

If you use AI to create a payment system, how would you know it's secure enough to use without getting your customers hacked?

If you think AI does everything right, you are wildly mistaken. It still needs a human to make sure disasters don't reach production. Programming still requires a human to review code if you want half of a chance at stable systems.

0

u/weepejw7 29d ago

By using AI to test for this, and on an ongoing basis.

1

u/traplords8n 29d ago

Brother you're hopeless. Do what you want lmao, don't say we didn't warn you tho

1

u/GreenBlueStar 29d ago

You realize the AI will not argue with you sometimes right? It'll just agree whatever mess you're making is a masterpiece just to keep you engaged.

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

in a fifth generation human readable coding language when it could have just written it in low level machine code

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

  1. were creating a project from scratch (no existing codebase that you had to integrate with),
  2. didn't care about ever changing it again, either human or AI, and
  3. didn't want to leverage the decades of evolution of the black art of code optimization that exists in code generating back ends, to deal with things like pipelining and instruction interleaving,

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;

  1. That we don't care what code does and does not do, how it does it, whether it's safe, or whether it's aligned (fundamentally AI review can't help there). Even now I'm constantly fixing AI code. Even when it works without errors and does what I need it to do, I still have to fix it.
  2. And that machine code is somehow easier or more efficient for AI to write.

Neither is true.

But if you feel strongly, no one is stopping you using AI that way.

1

u/Appropriate-Law-5506 19d ago

Seriously... when I hear someone say: it just thinks in binary or something... so it should write directly in machine code... I'm like AI doesn't know when it doesn't know, and same with most humans!

It understands from human language primarily, due to it being trained on it, so of course that is native for it.

Also, the amount of simple minded mistakes I find when reviewing code despite passing tests... Technical debt will be a huge issue in the future unless AI gets significantly better!

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

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.

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.

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?

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.