Key Takeaways

- Bun's Rust rewrite has been merged and is available in canary builds
- Binary size drops by 3 MB to 8 MB depending on platform
- The rewrite fixes several memory leaks and flaky tests while maintaining the same architecture
What Just Happened
Jarred Sumner, creator of Bun, merged pull request #30412 on May 8, 2026. The PR rewrites Bun's core from Zig to Rust. It's now live in canary builds.
This is a big deal for the JavaScript runtime that has positioned itself as a faster, all-in-one alternative to Node.js. Bun handles package management, bundling, testing, and runtime execution. Rewriting its foundation in Rust gives the team access to the language's memory safety guarantees without sacrificing performance.
The Technical Details
According to Sumner's notes in the PR, the Rust rewrite passes Bun's entire pre-existing test suite on all platforms. It also fixes several memory leaks and flaky tests that had plagued the project.
The architecture stays the same. So do the data structures. Bun still uses few third-party libraries. And there's no async Rust, which is notable. Async Rust has a reputation for complexity, and avoiding it keeps the codebase more straightforward.
Benchmarks range from neutral to faster. Sumner didn't release specific numbers yet, but promised a blog post with details. The real win, as he describes it, is tooling: Rust's compiler catches memory bugs that previously cost the team enormous development and debugging time.
How to Try It
If you want to test the Rust-based Bun, run:
bun upgrade --canarySumner asked users to file issues if they hit problems. He also noted there's still optimization and cleanup work before this lands in a stable release. Expect follow-up PRs.
Why Rust, Why Now
Bun was originally written in Zig, a systems language that offers manual memory control and C interop. Zig is fast and lean, but it lacks Rust's borrow checker. The borrow checker is Rust's signature feature. It prevents entire categories of memory bugs at compile time rather than runtime.
For a project like Bun, which handles complex operations like bundling, transpiling, and package resolution, memory bugs are a constant threat. They cause crashes, security vulnerabilities, and unpredictable behavior. Sumner's comment about the "enormous amount of development and debugging time" suggests these issues were a real drag on the project.
Rust also has a larger ecosystem and community than Zig. More developers know it. More tools support it. That could help Bun attract contributors.
What Stays the Same
The user-facing API isn't changing. If you're using Bun today, your code should work the same way after the Rust rewrite lands in stable. The architecture, data structures, and minimal dependency philosophy all remain.
This is a foundation change, not a product pivot. Bun is still Bun. It just has a more robust engine underneath.
Logicity's Take
What to Watch For
Sumner promised a blog post with more details. That should include specific benchmark numbers and a deeper explanation of the migration process. Given the complexity of rewriting a JavaScript runtime, that post will likely be a valuable case study for anyone considering a similar migration.
The canary period will reveal edge cases. If you depend on Bun in production, wait for the stable release. If you're curious or want to help find bugs, now's the time to test.
Frequently Asked Questions
Is Bun now written entirely in Rust?
The core has been rewritten in Rust. The overall architecture and data structures remain the same, and Bun still uses few third-party libraries.
Will the Bun Rust rewrite break my existing code?
No. The rewrite passes Bun's entire existing test suite. Your code should work the same way.
When will the Rust version of Bun be stable?
It's currently in canary. Sumner said there's still optimization and cleanup work before a stable release, but didn't give a specific date.
Is the Rust version of Bun faster?
Benchmarks range from neutral to faster according to Sumner. Specific numbers haven't been released yet.
Why did Bun switch from Zig to Rust?
Rust's compiler-assisted memory safety tools help catch and prevent bugs that were costing the team significant debugging time.
Need Help Implementing This?
Source: Hacker News: Best
Manaal Khan
Tech & Innovation Writer
Produced with AI assistance and reviewed by the Logicity editorial team. Learn more in our Editorial Policy.
Related Articles
More in Trending Tech
Humanity Just Went Farther Into Space Than Ever Before — And Made It Back Alive
Four astronauts splashed down in the Pacific Ocean on April 10, 2026, after traveling farther from Earth than any human beings in history. The Artemis II crew shattered a 56-year-old distance record set by Apollo 13, journeying nearly 253,000 miles from our planet during their 10-day lunar flyby mission. This marks the first time humans have ventured beyond low Earth orbit since 1972.

Amflow's Electric Bikes Are Blowing The Competition Away
Amflow, the e-bike brand spun out of DJI, has just released two impressive new electric mountain bikes that are breaking the mold with unprecedented power, range, and lightness. The flagship bikes are powered by the innovative Avinox motors and come with features like onboard navigation and heart rate control.

Canva Just Made a Power Play: Here's What It Means for the Future of Design and Marketing
Canva has made a bold move by acquiring two companies, Simtheory and Ortto, to boost its AI and marketing automation capabilities. This strategic move is set to revolutionize the way teams work on design and marketing projects. With these acquisitions, Canva is poised to become an all-in-one platform for businesses and individuals alike.



