logoalt Hacker News

Learnings from 100K lines of Rust with AI (2025)

100 pointsby pramodbiligiritoday at 10:04 AM102 commentsview on HN

Comments

chaddtoday at 11:57 AM

We're working on a large Rust codebase, heavily assisted development with Claude and Codex, and one critical workflow is after you have written a spec, have the other LLM critique it thoroughly.

This back and forth will take quite a while, but the resulting implementation plan will be 10x better than the original.

You can automate this by giving Codex a goal, and a skill to call Claude to review the implementation spec until they both agree it's done.

Then, for critical code, have them both implement the spec in a worktree, then BOTH critique each other's implementation.

More often than not, Claude will say to take 2 or 3 pieces from it's design over to Codex, but ship the Codex implementation.

show 6 replies
torben-friistoday at 10:31 AM

>Testing is the first layer of defense. My system now includes 1,300+ tests — from unit tests to minimal integration tests (e.g., proposer + acceptor only), all the way to multi-replica full integration tests with injected failures. See the project status.

I know LOC is a silly metric, but ~1300 tests for 130k lines averages out to a test per 100 lines - isn't this awfully low for a highly complex piece of code, even discounting the fact that it's vibecoded? 100 LOC can carry a lot of logic for a single test, even for just happy paths.

show 2 replies
jdw64today at 10:53 AM

I'm also shifting to an vibe coding workflow, but I have a genuine question: whenever I use AI for Rust, it makes an insane amount of lifetime errors. I have no idea how people are churning out so many lines of code so quickly.

Honestly, despite all the hype around Rust in the community, the fact that AI can't handle lifetimes reliably makes me reluctant to use it. The AI constantly defaults to spamming .clone() or wrapping things in Rc, completely butchering idiomatic Rust and making the output a pain to work with.

On the other hand, it writes higher-level languages better than I do. For those succeeding with it, how exactly are you configuring or prompting the AI to actually write good, idiomatic Rust

show 16 replies
icemanxtoday at 11:13 AM

How many of those tests have you actually read yourself if all of them are generated by AI (also when you're sleeping) ?

This is from 2025 - I would like to see an update now how that system turned out to be after the vibe hype

show 1 reply
misja111today at 12:26 PM

To me, the real question after reading this, is: Is your new implementation of Azure’s RSL now being used?

If it is, and it works well, then to me this is far more meaningful than the fact that AI wrote 130K lines of code.

sltrtoday at 1:08 PM

Contrarian view: Why English will never be a programming language. https://www.slater.dev/2026/05/why-english-will-never-be-a-p...

staszewskitoday at 10:27 AM

It's almost guaranteed with agents you could do the same job with less than half of 100k lines. I don't know whats impressive in lines of code generated by agent.

show 2 replies
bio-stoday at 1:30 PM

I have Tarpaulin code coverage check and everytime that it drops below the treshold Claude gives up quickly and just lowers the threshold. I don't know how to overcome it. CLAUDE.md neither AGENTS.md help but the LLM always finds its way.

nilirltoday at 10:32 AM

Is the idea of the runtime contracts similar to the idea of runtime validation? Or are they different in some way?

show 1 reply
chemextoday at 11:56 AM

How are you keeping the requirement, design, and tasks docs in sync as the code evolves? I'm curious if anyone's landed on a good workflow for this.

show 1 reply
danbructoday at 11:32 AM

Paxos is certainly non-trivial in the sense that tiny changes can break it, but in terms of functionality it is not that big. 50 KLOC just seems like a lot of code to me.

valcron1000today at 2:02 PM

Where can we read the code?

10g1ktoday at 11:38 AM

Lessons. There's no such thing as learnings.

show 3 replies
kikimoratoday at 12:05 PM

This is great example of AI slop and a big problem with AI coding.

Original RSL library has 36 KLoC across C++ source and headers files. Rust supposed to be more expressive and concise. Yet, AI generated 130k LoCs. I guess nobody understands how this code works and nobody can tell if it actually works.

show 1 reply
bharxhavtoday at 11:22 AM

Rust is about abstractions more than code. You can ask AI to "Optimize/Test/Clarify" but at the end of the day you should be willing to blindly agree to it's output or spend more time reviewing someone else's code.

faangguyindiatoday at 10:54 AM

Rust code generation consumes lot of token

Go is much better target, i've observed rails/ruby code is also much easier for AI to spit out.

And Haskell flies with AI

show 1 reply