logoalt Hacker News

pbiggaryesterday at 9:48 PM3 repliesview on HN

When I think of how a "compiler" could make these optimizations, I think the right place is an optimizing LLM (so, just a regular coding agent that you prompted to find optimizations like this one), making the changes in source at the request of the developer. That provides the dev with adequate input on whether they would like to opt-in to an unsafe optimization like this one. The compiler can continue to do deterministically-safe optimizations.


Replies

gpmyesterday at 10:56 PM

What I'd like to enable this use of LLMs more recklessly is a compiler with formal methods that lets me guarantee equivalence between the opaque optimized code and something actually understandable.

show 1 reply
trickypryesterday at 9:59 PM

That seems like a horrible idea:

1. Do you really want the rust compiler to run at the speed of an llm?

2. Compiler optimisations are already extremely unpredictable with deterministic compilers[1], I hate to think how unpredictable your compiler would be.

3. What if someone else wants to build the software, do they have to decide on optimisations now? What if the optimisation depends on your features not available on old generations of CPU? (There is a reason we don’t compile with -march=native)

4. Compilers already have “unsafe” optimisations, but people rarely enable them (-ffast-math)

[1]: https://faultlore.com/blah/oops-that-was-important/

show 1 reply
aa-jvtoday at 9:06 AM

We'll get there eventually whether we like it or not. Just as soon as the current crop of AI/ML engineers retire, or .. get replaced with bots.