Rewrite Bun in Rust has been merged
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Before you orderOffer from Amazon

Get the latest gadgets delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

The Bun team has merged a significant rewrite of parts of the runtime in Rust. The update passes all existing tests, reduces binary size, and offers performance improvements. The change aims to improve stability and developer productivity.

The Bun team has merged a rewrite of its core engine in Rust, marking a major milestone in the project’s development. The update aims to improve performance, stability, and developer productivity, and is now available for testing via the –canary upgrade command.

The recent merge involves rewriting parts of Bun’s codebase in Rust, which has successfully passed all of Bun’s existing test suite across multiple platforms. The update also addresses several memory leaks and flaky tests, contributing to enhanced stability. Additionally, the binary size has been reduced by 3 to 8 MB, and benchmark results indicate performance improvements that are neutral or faster than previous versions.

According to the team, the core architecture and data structures remain largely the same, with minimal third-party dependencies. The Rust code integrates with Bun’s existing system, and the team emphasizes that no asynchronous Rust features are used. The merge also introduces compiler-assisted tools for detecting and preventing memory bugs, which have historically consumed significant debugging time.

Why It Matters

This development is significant because it represents a major step toward making Bun more stable, faster, and easier to maintain. The use of Rust for core components leverages its memory safety features, potentially reducing bugs and security vulnerabilities. For developers, this could mean a more reliable runtime and faster iteration cycles, impacting the broader JavaScript runtime ecosystem.

Products Worth Considering

Apple MacBook Air 13.6-inch with M5 Chip, 16GB Memory, 512GB SSD, Sky Blue

Apple MacBook Air 13.6-inch with M5 Chip, 16GB Memory, 512GB SSD, Sky Blue

Amazon Kindle Scribe (64GB) with Premium Pen, Metallic Jade

Amazon Kindle Scribe (64GB) with Premium Pen, Metallic Jade

As an affiliate, we earn on qualifying purchases.

Background

Bun is an alternative JavaScript runtime focusing on performance and developer experience. Prior to this merge, Bun primarily used C++ and some third-party libraries. The team has been exploring Rust as a way to improve safety and performance. The current merge is part of ongoing efforts, with further optimization and cleanup work planned before this version is included in the stable release.

“The Rust rewrite passes all our pre-existing tests, fixes memory leaks, reduces binary size, and offers performance gains. It’s a significant step forward.”

— Bun team member

“Compiler-assisted tools for memory safety will help us catch bugs earlier and reduce debugging time moving forward.”

— Bun developer

What Remains Unclear

It is not yet clear when this Rust-based code will be fully integrated into the stable release of Bun, or how it will perform under widespread production use. Further optimization and testing are ongoing, and the team has indicated additional cleanup work is planned.

What’s Next

The next steps include further optimization, bug fixing, and code cleanup before this Rust rewrite is merged into the non-canary, stable version of Bun. The team also plans to monitor user feedback from the canary release and address any issues that arise.

Key Questions

What does the Rust rewrite mean for Bun performance?

The rewrite is expected to improve performance and stability, with benchmark results showing neutral to faster performance compared to previous versions.

Will this change affect existing Bun users?

For now, the update is available via the –canary upgrade command. Once fully integrated into the stable release, users should experience improved stability and performance.

Are there any risks associated with this Rust rewrite?

The team reports passing all tests, but as with any major code change, some unforeseen issues could arise during wider testing and deployment.

When will this Rust-based version be available in the stable release?

The team has not provided a specific timeline but indicates that additional cleanup and optimization are needed before full deployment.

What are the benefits of using Rust in Bun?

Rust offers memory safety, reduced bugs, and potential performance enhancements, which can lead to a more reliable and efficient runtime.

You May Also Like

The Stanford AI Index 2026 Audit: Reading the Field’s Annual Report Card With a Critic’s Pen

The Stanford AI Index 2026 has been released, offering a comprehensive but partially limited assessment of AI progress and policy. This analysis evaluates its strengths and weaknesses.

Breaking Up With Google Play: Why Conversations Is Now Free

Interest is spiking around “Breaking Up with Google Play: Why Conversations Is Now Free,” but the reason for the attention is unconfirmed.

Eileen OConnell Stirs Emotions in Volvo Commercials

Witness the captivating power of Eileen O'Connell in Volvo commercials, where her emotional performances leave a lasting impact on viewers worldwide.

From Child Stars to Adult Success: Tracking the Careers of Young Celebrities

Explore the journeys of young celebrities as we delve into “From Child Stars to Adult Success: Tracking the Careers of Young Celebrities.”