frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://zfhuang99.github.io/rust/claude%20code/codex/contracts/spec-driven%20development/2025/12/01/rust-with-ai.html
37•pramodbiligiri•1h ago

Comments

staszewski•51m ago
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.
ndr•48m ago
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.

ashirviskas•21m ago
> 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.

sreekanth850•10m ago
For a startup with limited funding, building a product is no more a bottleneck. every one doesn't have the same access to funding!
torben-friis•47m ago
>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.

risyachka•38m ago
I may have missed it but are those tests written by person or generated? Otherwise how do you know they even test anything (like actually test, not appear to test)
kawogi•38m ago
IIUC only 50k LoC are non-test code, which improves the metric. Whether that's enough tests still depends on the code. If most are getters and setters, the coverage might be ok.
nilirl•46m ago
Is the idea of the runtime contracts similar to the idea of runtime validation? Or are they different in some way?
pramodbiligiri•31m ago
It is described in the "Code Contracts" section of the article: "Code contracts specify preconditions, postconditions, and invariants for critical functions. These contracts are converted into runtime asserts during testing but can be disabled in production builds for performance". The .NET framework article that he links to: https://learn.microsoft.com/en-us/dotnet/framework/debug-tra...
nilirl•25m ago
Ah, I missed the reference. Thanks a lot!
jdw64•25m ago
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

dijit•23m ago
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.
hydra-f•19m ago
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

vermilingua•12m ago
The irony of the machines having no mechanical sympathy is just too good
faitswulff•11m ago
What kinds of programs are you writing and with what models? I'm curious if the lifetimes your programs require are trickier than most.
embedding-shape•6m ago
> 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.

faangguyindia•24m ago
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

jgilias•12m ago
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.
icemanx•5m ago
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

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

https://zfhuang99.github.io/rust/claude%20code/codex/contracts/spec-driven%20development/2025/12/...
40•pramodbiligiri•1h ago•20 comments

Everything in C is undefined behavior

https://blog.habets.se/2026/05/Everything-in-C-is-undefined-behavior.html
232•lycopodiopsida•5h ago•292 comments

Gemini 3.5 Flash

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-5/
819•spectraldrift•17h ago•569 comments

FiveThirtyEight articles on the Internet Archive

https://fivethirtyeightindex.com/
223•ChocMontePy•9h ago•53 comments

I’ve built a virtual museum with nearly every operating system you can think of

https://virtualosmuseum.org/
805•andreww591•19h ago•174 comments

The weird, wild story of humanity's obsession with gold

https://www.economist.com/culture/2026/05/14/the-weird-wild-story-of-humanitys-obsession-with-gold
11•andsoitis•2h ago•4 comments

Japan is gripped by mass allergies. A 1950s project is to blame

https://www.bbc.com/future/article/20260515-the-1950s-blunder-which-causes-mass-hay-fever-in-japan
134•ranit•9h ago•62 comments

Infomaniak transitions to a foundation model to protect user data privacy

https://news.infomaniak.com/en/infomaniak-foundation-sovereign-cloud/
91•darktoto•5h ago•21 comments

Google changes its search box

https://blog.google/products-and-platforms/products/search/search-io-2026/
572•berkeleyjunk•16h ago•756 comments

Show HN: Forge – Guardrails take an 8B model from 53% to 99% on agentic tasks

https://github.com/antoinezambelli/forge
512•zambelli•22h ago•177 comments

Remove-AI-Watermarks – CLI and library for removing AI watermarks from images

https://github.com/wiltodelta/remove-ai-watermarks
300•janalsncm•12h ago•176 comments

Apple unveils new accessibility features

https://www.apple.com/newsroom/2026/05/apple-unveils-new-accessibility-features-and-updates-with-...
682•interpol_p•23h ago•353 comments

Show HN: Typeset sitelen pona and copy a PNG (for toki pona speakers)

https://sitelen.vercel.app/
8•vitaly-pavlenko•2d ago•1 comments

Mistral AI acquires Emmi AI

https://www.emmi.ai/news/mistral-ai-acquires-emmi-ai
269•doener•16h ago•82 comments

OpenAI Adopts Google's SynthID Watermark for AI Images with Verification Tool

https://openai.com/index/advancing-content-provenance/
290•smooke•15h ago•157 comments

Gemini CLI will stop working from June 18, 2026

https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/
243•primaprashant•17h ago•125 comments

Incident Report: Railway Blocked by Google Cloud (Resolved)

https://blog.railway.com/p/incident-report-may-19-2026-gcp-account-outage
485•aarondf•10h ago•311 comments

CopyFail: From Pod to Host

https://xint.io/blog/copy-fail-pod-to-host
25•tptacek•17h ago•3 comments

In 1979 engineer Hugh Padgham discovered "gated reverb" – by accident

https://producelikeapro.com/blog/how-one-recording-mistake-created-a-musical-phenomenon-in-the-80s/
53•bookofjoe•2d ago•17 comments

RISC-V and Floating-Point

https://fprox.substack.com/p/risc-v-and-floating-point
23•hasheddan•1d ago•18 comments

Simulated Evolution on the PICO-8

https://bumbershootsoft.wordpress.com/2026/05/16/simulated-evolution-on-the-pico-8/
15•ibobev•1d ago•0 comments

GitHub is investigating unauthorized access to their internal repositories

https://twitter.com/github/status/2056884788179726685
475•splenditer•11h ago•250 comments

Nostalgic Kits Central (2024)

https://www.nostalgickitscentral.com/
24•cf100clunk•2d ago•12 comments

Minnesota becomes first state to ban prediction markets

https://www.npr.org/2026/05/19/nx-s1-5821265/minnesota-ban-prediction-markets
678•ortusdux•16h ago•207 comments

The Mercury logic programming system

https://github.com/Mercury-Language/mercury
68•Antibabelic•2d ago•15 comments

Growing Neural Cellular Automata

https://distill.pub/2020/growing-ca/
117•pulkitsh1234•2d ago•12 comments

I’ve joined Anthropic

https://twitter.com/karpathy/status/2056753169888334312
1341•dmarcos•20h ago•559 comments

Lisp in Web-Based Applications (2001)

https://sep.turbifycdn.com/ty/cdn/paulgraham/bbnexcerpts.txt
86•bschne•1d ago•7 comments

Enabling Resizable Bar on RTX 3080 Vbios via GitHub

https://github.com/danindiana/rtx3080-rebar-vbios/tree/master
4•linux_lorax•2d ago•3 comments

Why is almost everyone right-handed? A new study connects it to bipedalism

https://www.ox.ac.uk/news/2026-05-15-why-is-almost-everyone-right-handed-the-answer-may-lie-in-ho...
134•gmays•20h ago•216 comments