Can your AI rewrite your code in assembly?(lemire.me)
lemire.me
Can your AI rewrite your code in assembly?
https://lemire.me/blog/2026/04/05/can-your-ai-rewrite-your-code-in-assembly/
7 comments
I had a similar thinking that this should be one of the most important USP for LLMs in coding. Does anyone here has more insights or experience in using LLM to cut through years of abstractions and just rewrite code in asm or any other low-level language?
> An open question is whether the AIs could find optimizations that are not possible if we use a higher-level language like C or C++. It is an intriguing question that I will seek to answer later. For the time being, the AIs can beat my C++ compiler!
Go throw yourself at Stockfish or another chess engine for this. They tend to have good test harness that can give you an idea of whether the speedups are worth the effort.
Go throw yourself at Stockfish or another chess engine for this. They tend to have good test harness that can give you an idea of whether the speedups are worth the effort.
Doesn't the compiler rewrite your code in assembly?
commenting without reading the article, your being naughty again :o)
I did read it. A compiler converts your code into assembly. They usually have varying levels of optimisation depending on what you're doing.
The article boils down to "could AI be a good compiler" and I'd say that consistency and repeatability are far more important than a one-off optimisation of a particular section of code. If you've got to the point where a section of code is worth writing some hand-crafted assembly then it's probably worth your time to really understand what's happening with it. Having it "vibe compiled" for you would be a bad idea.
The article boils down to "could AI be a good compiler" and I'd say that consistency and repeatability are far more important than a one-off optimisation of a particular section of code. If you've got to the point where a section of code is worth writing some hand-crafted assembly then it's probably worth your time to really understand what's happening with it. Having it "vibe compiled" for you would be a bad idea.