Live data from Hacker News

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

zfhuang99.github.io

111–120 of 225 posts

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

#111
post #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.

Why would the language being typographically ugly matter? Python's pretty, but it hides a lot of functional nuance behind that. Rust is terse, but it's also expressive in its terseness.

If you want to give it a fair shot, it does take some time to get used to, coming from something like Python or Ruby. I won't deny that. I've found that using LSP-assissted semantic syntax highlighting helps, for me, on the typographic front.

I don't think typographic design is a key consideration in most languages' designs, though, and I don't think it should be. The main thing I look for is consistent, relatively predictable rules around the syntax, as far as that layer of language choice goes.

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

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

> whenever I use AI for Rust, it makes an insane amount of lifetime errors. What model are you using, and what frameworks are you using? This is not a hard problem for LLMs to solve. Rust is nearly the perfect language for LLMs. It's exceptionally expressive, and it forbids entirely the most common globally complex bugs that LLMs simply do not (and won't for some time) have the context window size to properly reason…

This is likely a fully LLM-generated reply.

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

#114
post #98

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.

[flagged]

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

#116
post #79
post #50

Earlier quoted context omitted.

A lesson would be a specific learning activity happening at a specific place and time, administered by a person more knowledgeable than you; like a teacher or mentor "giving a lesson". If you're fine with the generalized form "learned a lesson", then surely "learnings" is fine too. There's no point in trying to police a completely normal and sensible use of language.

So when you cause an incident because you did not pay attention and "learn your lesson" who's the mentor?

The universe.

Anyway, I accept this usage of the word "lesson", so I also accept "learnings". My point was one of hypocrisy, not policing people in how they can use the word "lesson".

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

#117
post #106

Earlier quoted context omitted.

LLMs aren't people. They don't reason. They're token generators, a black box. Your analogy falls on its face with any scrutiny.

They very obviously reason.

it's kind of crazy to think that the transformer architecture can't encode some primitive form of reasoning.

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

#118
post #54

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

This is astrology for devs.

Unless you can somehow provide some arguments against it, I feel like you're the one who is trying to cargo-cult stuff here.

Say what you will with proper reasoning or arguments if you feel compelled, tired reddit-commentary like that helps no one.

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

#119
I've found Rust's safety guarantees to be less useful for slop-generated code because LLMs can always fight their way through the borrow checker by spamming enough Arc>>> and clone() everywhere. Rust only gives you safety properties, not liveness. Interior mutability is a fantastic tool for turning safety failures into liveness failures. Remember kids: deadlock is a safe outcome.

It works for humans because when we get a borrow-check failure, we take a step back and think about the global shape of our code and ownership. LLMs path straight to the goal. Problem: code doesn't compile. Solution: more clone()

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

#120
I am having a different experience than a lot of other commenters here vibe coding with Rust. I am not a Rust programmer or evangelist. I have implemented a drop-in Bash replacement/clone in Rust that passes the upstream Bash test suite and a whole battery of its own. It is a tiny bit faster than Bash itself but consumes a bit more memory. But Codex and Claude both did a great job with it.

I also had it implement a wasm geodesic calculator in Rust and it's amazing and in my use case is better than geodesiclib using the same updated algorithm.

I'm a "C-nile" Rust folks love to hate and did my first hacking in C Deep Blue C on Atari 8-bits. But I'm very impressed with these products and with the ability to leverage some features of Rust with them. (e.g. audit every unsafe instance and define its invariants, etc.)

I also agree with the commenter who said these LLMs are today, at the present moment, good at Go. The only language I notice it seems to be really good above and beyond others at is javascript, I assume because there's so much of it.

Post reply on HN