RC RANDOM CHAOS

Bun's Rust rewrite lands: smaller binaries, fewer memory bugs, no async Rust

· via Hacker News

Original source

Rewrite Bun in Rust has been merged

Hacker News →

The Bun JavaScript runtime has merged a full rewrite from Zig to Rust, passing the existing test suite across all platforms while fixing several memory leaks and flaky tests along the way. Binary size drops by 3 to 8 MB, benchmarks land between neutral and faster, and the team gains compiler-assisted memory safety tooling — addressing what maintainers describe as years of costly debugging from memory bugs.

Architecturally, little else changes. The same data structures and minimal third-party dependency footprint carry over, and notably the rewrite avoids async Rust entirely. Users can test the new build via bun upgrade —canary, though further optimization and cleanup work remains before it ships in stable releases.

The move is significant for the runtime wars: Bun was one of the higher-profile production users of Zig, and switching to Rust signals that compiler-enforced memory safety outweighed the language-loyalty argument for a project where stability and performance are core selling points.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.