Live data from Hacker News

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

zfhuang99.github.io

21–30 of 225 posts

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

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

I'm actually vibe coding a game engine right now using a Hexagonal Architecture, and I ran into this exact same issue when trying to synchronize the feedback loop between the viewport and the editor. To be fair, I probably messed up the domain boundaries myself in the first place, but honestly, the AI-generated code wasn't very effective at solving it either

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

#22
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 think it's due to the lack of quality instructions on what is good Rust code; AI often literally doesn't know what idiomatic Rust is. It can be good to have a reference where you write the basic rules that you want it to follow (ideal to assume it has no idea why spamming clone is bad and you're speaking to someone who has just watched one of those youtube videos with a dude in black t-shirt speaking very slowly and going over basic programming concepts as if they're breaking you out of the matrix).

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

#23
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 wrote and maintain this library of skills and workflows called Rust Bucket[0]

It sets up your repo to ensure agents use a workflow which breaks your user requests down into separate beads, works on them serially, runs a judge agent after every bead is complete to apply code quality rules, and also strict static checks of your code. It's really helpful in extracting long, high-quality turns from the agent. It's what we used to build Offload[1].

0: https://github.com/imbue-ai/rust-bucket : A rusty bucket to carry your slop ;)

1: https://github.com/imbue-ai/offload

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

#24
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’ve been writing almost exclusively Rust with LLMs and rarely ever hit this. I guess maybe the kind of work you are doing?

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

#25
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…

Clone is not "butchering idiomatic Rust", we gotta stop this nonsense

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

#26
post #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

use "stage_fixed" to automatically persist the formatting :)

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

#28
post #3

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 just an anchor. If it were 50k would you say the same down to 25k? And if so how many more times would it apply? The interesting thing is that it was manageable solo (in many ways it's _more_ manageable solo+AIs than with coworkers+(their)AIs), and in such a short amount of time.

the interesting thing is how fast it becomes unmanagable.

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

#29
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…

Clone is not "butchering idiomatic Rust", we gotta stop this nonsense

Sorry, should clarify. .clone() itself isn't inherently unidiomatic when used .

My issue is specifically with how the AI uses it. In AI code, .clone() is almost always used as a brute-force escape hatch

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

#30
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…

Honestly Rust is an UGLY language. For whatever powers it possesses in memory safety, its cryptic symbology is reminiscent of assembly.

This is a problem when language designers are mathematicians and don’t understand typographical nuance and visual weights.

Post reply on HN