AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

Bun has merged a significant rewrite in Rust, passing all pre-existing tests, fixing memory leaks, reducing binary size, and maintaining performance. This development aims to improve stability and developer productivity.

The Bun JavaScript runtime has completed a major code rewrite in Rust, passing all existing tests and fixing several memory leaks, marking a significant milestone in its development.

According to a recent developer update, the Bun team has merged a rewrite of its core codebase in Rust. The new version passes Bun’s pre-existing test suite across all platforms and addresses several memory leaks and flaky tests. The binary size has been reduced by between 3 MB and 8 MB, and benchmarks indicate performance is at least maintained and potentially improved. The rewrite retains the same architecture and data structures, with minimal external dependencies, and does not include asynchronous Rust features. Developers are encouraged to test the canary version using the command ‘bun upgrade –canary’ and report issues. The team notes ongoing work to optimize further and prepare for a stable release, with additional cleanup and improvements planned in subsequent pull requests.

Why It Matters

This development is significant because it marks a shift towards a more memory-safe and potentially more performant core for Bun, which is gaining popularity as a JavaScript runtime alternative. The use of Rust aims to improve stability, reduce debugging time, and streamline future development. For developers, this could translate into more reliable applications and a smoother development experience, especially in performance-critical environments.

Products Worth Considering

Apple MacBook Air 13-inch Laptop with M5 Chip, 16GB Memory, 512GB SSD, Liquid Retina Display, and Touch ID – Midnight

Apple MacBook Air 13-inch Laptop with M5 Chip, 16GB Memory, 512GB SSD, Liquid Retina Display, and Touch ID – Midnight

LG UltraGear 32GX850A-B 32-inch 4K UHD Glossy OLED Gaming Monitor

LG UltraGear 32GX850A-B 32-inch 4K UHD Glossy OLED Gaming Monitor

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 has been under active development as a fast JavaScript runtime built with a focus on performance and low resource usage. Previously, it relied on a mix of JavaScript and some external libraries, with ongoing efforts to improve stability and efficiency. The recent merge of the Rust rewrite follows a series of internal tests and benchmarks, with the team emphasizing that the code structure remains largely unchanged, aside from the language switch. The move to Rust is part of a broader trend in the JavaScript ecosystem to adopt safer, more efficient systems programming languages for core components.

“The rewrite in Rust passes all tests, fixes memory leaks, and reduces binary size. Benchmarks are neutral to faster, and we now have compiler-assisted tools for catching memory bugs.”

— Bun developer on Hacker News

“We’re still doing some optimization and cleanup work before this lands in the stable version. Please try the canary and report issues.”

— Bun team spokesperson

What Remains Unclear

It is not yet clear when the Rust-based version will be officially released to all users or how it will impact existing workflows in production environments. Details about long-term stability and compatibility are still emerging.

What’s Next

The team plans to continue optimization, bug fixing, and cleanup in follow-up PRs. A stable release is anticipated once testing in the canary version confirms reliability. Users are encouraged to try the canary build and provide feedback.

Key Questions

What does the Rust rewrite mean for Bun users?

The rewrite aims to improve stability, reduce bugs, and potentially boost performance, making Bun more reliable for production use.

When will the new version be officially released?

The team has not provided a specific release date but expects to finalize testing and optimizations before a stable release, possibly within the coming months.

Will this change affect existing Bun projects?

Most existing projects should remain compatible, as the architecture and data structures are largely unchanged. However, users should test their projects with the canary build for compatibility issues.

Are there any known issues with the current merge?

As of now, the merge is considered successful, but ongoing testing may reveal bugs or performance issues that are being addressed in follow-up updates.

You May Also Like

ALIA. The Spanish answer.

Spain unveils ALIA, a 40B multilingual LLM trained on 9.37 trillion tokens, marking Europe’s largest public AI initiative with €240M investment.

The Case For Caution In Reading Google’s AI Satellite Haiku

Google says Gemma 4 generated a haiku aboard a satellite carrying TPUs. The test marks progress for Project Suncatcher, not a space data center.

Color Management for Scanners: Keep Colors Honest

Color management for scanners ensures accurate reproduction; learn essential calibration and workflow tips to keep your colors honest and consistent.

Smartphone LED Detects Hidden Cameras With AI

A new smartphone feature leverages LED lights and AI to identify concealed cameras, sparking increased interest amid privacy concerns.