Bun ported to Rust in 6 days
Source: Hacker News
Overview
- Test coverage: 99.8 % of Bun’s pre‑existing test suite passes on Linux x64 glibc in the Rust rewrite.
- The codebase is essentially the same, but Rust now enforces lifetimes, provides deterministic destructors, and makes unsafe sections more obvious, encouraging refactoring.

Why
I’m tired of constantly worrying about memory leaks, crashes, and stability issues. A language that offers stronger guarantees—like Rust’s ownership and lifetime system—would dramatically reduce the time spent fixing these problems.
A forthcoming blog post will cover:
- What this means for Bun
- Benchmarks and memory‑usage comparisons
- Maintainability going forward
- The literal process of the rewrite (it wasn’t just “Claude, rewrite Bun in Rust. Make no mistakes.”)
Process
- The rewrite spans ≈ 960 000 lines of code.
- It compiles and passes the test suite on Linux, with other platforms to follow.
- The entire effort was started 6 days ago; doing it manually would have required a massive amount of work.
Community Reactions
-
@doodlestein – “I’ll do my own libc before that happens.”

-
@capajj – “There’ll be a blog post.”
-
@mutewinter – “It’s basically the same as in Zig using our faster Zig compiler. If we were using the upstream Zig compiler, the Rust port would compile faster.”