Live data from Hacker News

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

zfhuang99.github.io

11–20 of 225 posts

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

#12
post #9

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 w…

The feedback loop is the interesting part, if you use standard software engineering practices (modularise, test/document your interfaces, etc) then I find things like Claude Code do an exceptional job: since they can actually run cargo check/test themselves and can validate the tests too.

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

#13

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.

> It's almost guaranteed with agents you could do the same job with less than half of 100k lines.

That's great, non-test code is only ~47k lines of code.

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

#14
post #9

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 w…

A lefthook:

format: glob: ".rs" run: cargo fmt -- --check

lint: glob: ".rs" run: cargo clippy -- -D warnings

tests: run: cargo test

audit: run: cargo audit

+ hooks that shove the lefthook automatically in the ai's face

---

rustfmt.toml:

edition = "2021" newline_style = "Unix" use_small_heuristics = "Max" max_width = 100

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

#15
post #9

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 w…

The irony of the machines having no mechanical sympathy is just too good

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

#16

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

Yes, but it comes with much better “built-in” guardrails to rein in the autocomplete. Especially if compared to something runtime-surprise-prone-if-lovable like Ruby.

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

#17
post #9

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 w…

What kinds of programs are you writing and with what models? I'm curious if the lifetimes your programs require are trickier than most.

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

#18

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.

For a startup with limited funding, building a product is no more a bottleneck. every one doesn't have the same access to funding!

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

#19
post #9

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 w…

> 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.

What harness and model you've been using? For the last few months, essentially since I did the whole "One Human + One Agent = One Browser From Scratch" experiment, I've almost exclusively been doing cross-platform native desktop development with Rust, currently with my own homegrown toolkit basically written from scratch, all with LLMs, mostly with codex.

But I can't remember a single time the agent got stuck on lifetime errors, that's probably the least common issue in regards with agents + Rust I come across. Much bigger issue is the ever-expanding design and LLMs being unable to build proper abstractions that are actually used practically and reduces the amount of code instead of just adding to the hairball.

The issue I'm trying to overcome now is that each change takes longer and longer to make, unless you're really hardcore about pulling back the design/architecture when the LLM goes overboard. I've only succeeded in having ~10 minute edits in +100K LOC codebases in two of the projects I've done so far, probably because I spent most of the time actually defining and thinking of the design myself instead of outsourcing it to the LLM. But this is the biggest issue I'm hitting over and over with agents right now.

Post reply on HN