Sitemap
Rustaceans

Insights and Expertise from Rustaceans

Member-only story

Can LLMs Actually Write Good Rust? Apparently, Yes

--

Press enter or click to view image in full size
Photo by Glenn Carstens-Peters on Unsplash

For a long time the answer felt obvious.

Rust’s ownership rules, lifetime annotations, and strict type system were supposed to be the things that kept casual code generators at bay.

Early models produced confident nonsense, dangling references that somehow compiled in the model’s imagination, unwrap() sprinkled like confetti, and trait bounds that existed only in the training data’s dreams.

Watching an LLM fight the borrow checker was a reliable source of dark entertainment. The skepticism was earned.

Something shifted. The models that matter now have absorbed enough real Rust that they no longer treat the language as an exotic dialect of C++.

They propose ownership patterns that hold. They reach for Arc and Mutex only when the data actually crosses threads.

They write error handling that uses Result instead of panicking on every edge.

The code that comes back often compiles on the first or second try, and more importantly, it frequently looks like something a competent human would have written under time pressure.

That last part is the interesting change. Compiles was never the high bar.

--

--