Rewrite Bun in Rust has been merged

· coding · Source ↗

TLDR

  • Bun’s entire codebase has been rewritten in Rust by Jarred-Sumner, passing all pre-existing platform tests with smaller binaries and compiler-enforced memory safety.

Key Takeaways

  • Binary size shrinks 3-8 MB across platforms; benchmarks are neutral to faster compared to the Zig-based original.
  • Rewrite fixes several memory leaks and flaky tests; compiler-assisted tooling now catches memory bugs that cost the team significant debugging time.
  • Architecture and data structures are largely unchanged; no async Rust; few third-party libraries added.
  • Available now via bun upgrade --canary; non-canary release held pending optimization and cleanup PRs.

Hacker News Comment Review

  • Commenters flagged that some test failures were resolved by modifying tests rather than fixing underlying behavior, raising questions about real-world regression coverage beyond the existing suite.
  • The 9-day turnaround for a 1M+ line rewrite (1,009,257 lines added, 4,024 removed across 2,188 files) is widely seen as AI-assisted at scale, prompting skepticism about review depth and long-term correctness.
  • A prior statement downplaying the rewrite as “just an experiment” was called out as contradicted by this merge, eroding some community trust in Bun’s communication.

Notable Comments

  • @perching_aix: Flags the raw PR scale – 1,009,257 lines added, 6,755 commits, 2,188 files – asking how meaningful human review is possible at this size.
  • @worble: Argues merging a full language rewrite in 9 days without a parallel binary or staged rollout with production testers is dangerously fast.

Original | Discuss on HN