HACKER Q&A
📣 GraphR00t

Do you think the use of low-level languages can decrease because of AI?


I am primarily referring to writing low-level code in order to speed up the execution of a program written in a high-level programming language.

We can consider a high-level program to be a detailed specification, especially when compared to pseudocode. Wouldn't it be possible for an AI in the near future to generate low-level code in order to speed up parts of the high-level program (hot path) ?

Even if the AI makes mistakes we can envision an automated system that continuously compares the behavior of the two versions of the code. Such a system would give feedback to the AI.

(Sorry for my bad English)


  👤 PaulHoule Accepted Answer ✓
It depends. I think an LLM will succeed at that some of the time but not all of the time because it is just faking it.

The old A.I. may be better for this, see

https://en.wikipedia.org/wiki/Superoptimization

or tools like

https://www.microsoft.com/en-us/research/project/z3-3/

I’ve seen cases where somebody used Z3 to pick a few assembly instructions to implement the body of a loop. Note the last two systems write a correct program every time, the LLM just makes a best effort. Some hybrid of an LLM that “understands” natural language and that other technology that can understand some code might be the winner.


👤 beardyw
> Wouldn't it be possible for an AI in the near future to generate low-level code in order to speed up parts of the high-level program (hot path)?

Compilers have been doing that for decades. AI would just add level of uncertainty. What a compiler does can be understood and traced back. No so AI.


👤 Bostonian
Actually your post suggests that AI may increase the use of low-level languages because of its ability to generate code. I think auto-generation of code, especially C, long predates LLMs.