logoalt Hacker News

tnelsond4today at 1:25 AM1 replyview on HN

Yeah, last year I discovered that AI writes better rust than C, so I switched to rust and it made some quick good code that it couldn't do in C.

But when I wanted to optimize and edit and reorganize bthe code it was difficult, so I did a rewrite in C and it was lighter and faster and simpler and less headache.

C for humans, rust for AI.


Replies

throwaway2037today at 8:05 AM

    > [L]ast year I discovered that AI writes better rust than C
I am not doubting your anecdata. I am curious about the why. C is so simple compared to Rust. Yes, I understand it is much more dangerous, but I am genuinely surprised by your discovery. Also, the open source training base in C is massive; I assume still much larger than Rust.

    > The best argument for Rust in 2026 is not memory safety or performance. It is that AI writes better Rust than it writes C++. The compiler feedback loop is so tight that models self-correct in real time. Every error message is a free training signal. Rust was accidentally designed for AI-assisted development 10 years before anyone knew that mattered.
This quote bothered me when I read it because it offers no evidence as to why LLMs are better at writing Rust than C++. LLVM can compile Rust (rustc) and C++ (clang) and should offer equally compelling error messages. C++ has notoriously hard-to-read (for humans!) template error messages, but that should not be a big issue for an LLVM. When I am stuck on a compiler error, I often turn to an LLVM and they can quickly make good suggestions.
show 1 reply