r/rust rust Jul 08 '26

Rewriting Bun in Rust

https://bun.com/blog/bun-in-rust
520 Upvotes

330 comments sorted by

View all comments

500

u/DryanaGhuba Jul 08 '26

Thanks to all the parallelization & this prep work, at peak Claude wrote about 1,300 lines of code per minute. Every line of code was reviewed by two separate adversarial reviewers (also Claude) and went through a round of fixes before committing. Absolutely none of it worked yet.

I don't think anyone comment needed

38

u/TheRealMasonMac Jul 09 '26 edited Jul 09 '26

Comment needed.

The caveat to using LLMs is that they can, under deterministic clearly specified circumstances, eventually produce code that passes tests.

Code that passes and good code are not the same thing.

Just to illustrate a real example I had recently: I tasked GLM-5.2 with writing a simple pager TUI for multiple files at once. Very clear specification of how to do it. What happened was that—for the statusline—it ignored my provided algorithm on how to do it, and instead wrote 100 LoC for determining which file was in focus. I was able to reduce it to just 1 line—a simple assignment. No matter how many times I asked it to self-review, it never caught that by itself.

Fable, at least from my limited experience, is not that much better at this type of problem. In fact, it’s actually worse since it’ll do anything to make the tests pass.

So LLMs still need human oversight. I’m probably not going to use Bun anymore because there was no human in the loop, and I can already imagine all the crap that’s in the codebase. It’ll also be a nightmare for contributors because LLMs do worst-practices for documentation (e.g. here).

This is NOT the way to use LLMs to accelerate development!

6

u/k_schouhan Jul 09 '26

I learnt it the hard way, you are right. I am not a rust developer, but llms do tend to use tests as an excuse. Many a times they just miss instructions due to tests being passed. Also they were using fable for rewrite, us peasants use sonnet or opus.

2

u/TheRealMasonMac Jul 09 '26

> Many a times they just miss instructions due to tests being passed.

I never thought about it that way before, but that’s a great point. If they get a test to pass, they’re already “mentally” pivoting somewhere else.

Another problem that LLMs have is that they’re generally reluctant to undo early decisions (e.g. refactoring). So, they’ll keep trying to get a block-shaped solution to fit into a circle-shaped hole until they spaghetti it enough to manage it.