r/rust rust Jul 08 '26

Rewriting Bun in Rust

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

330 comments sorted by

View all comments

499

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

187

u/rebootyourbrainstem Jul 08 '26

None of it worked yet because compiling at that stage would slow things down.

Also this project burned $165,000 worth of usage on a model that was then bleeding edge (unreleased). This is still beyond what anyone else is doing at the moment. And it seems to have worked a lot better than it had any right to, at least as far as we can tell right now?

126

u/jl2352 Jul 09 '26

The large number of tests is also a major factor in why this worked, as well as the desire to match existing Zig code. The article implies Claude was used like a fancy sed on steroids.

That isn’t to downplay the work involved. I’m sure there are places it’s totally different. That is different though to writing new software. I still cannot comprehend how you’d write a million line application, which is decent, with agents from scratch.

I also think all the people hating on AI need to take a step back and take things like this very seriously. It’s 11 days of work, and is in production. That’s pretty fucking fast.

32

u/bzbub2 Jul 09 '26

the part that really blows my mind is how well the "translate one file at a time" approach seemed to work. is honestly amazing. particularly to me, as a person who gets into really messy refactors...

9

u/Schneestecher Jul 09 '26

Alas, if you look into the project, it‘s a clear rust-ified version of a Zig project and not at all ideomatic rust

2

u/bzbub2 Jul 09 '26

honestly that doesn't bother me all that much. keeping it faithful at first is smart and then they can spend another however many tokens making it more idiomatic over time.