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.

Amazon

JavaScript runtime environment

As an affiliate, we earn on qualifying purchases.

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.

COLUMBUS DAY / I

Columbus Day / Indigenous Peoples' Day Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Astra Crosses The Line — And OpenAI Ships It Anyway, Gated

OpenAI has publicly acknowledged Astra’s critical cybersecurity capabilities and plans to release it with safeguards, amid ongoing safety concerns.

Microsoft’s unreleased cloud controller has been spotted in the wild and it’s teeny

Photos reveal an unreleased Microsoft cloud gaming controller, featuring Wi-Fi connectivity and a compact design, prompting speculation about upcoming product launch.

The Six Chokepoints: How AI Stopped Being a Utility and Became a Lever

In 2026, control over AI shifted from a neutral utility model to concentrated chokepoints, giving owners unprecedented leverage over AI capabilities and access.

TikTok Creators Offer Glimpses Into Life After Deportation

A revealing look at TikTok creators’ post-deportation lives uncovers emotional struggles and unexpected resilience—discover how they turn adversity into inspiration.