TL;DR

Jarred has rewritten Bun, a JavaScript runtime, in Rust, and the new implementation passes 99.8% of the existing test suite. This marks a major milestone in the project’s development.

Jarred has completed a rewrite of Bun, a JavaScript runtime, in Rust, achieving a 99.8% pass rate on the existing test suite, according to a recent post on X (Twitter). This development highlights a significant step forward in the project’s progress and potential performance improvements.

The effort to rewrite Bun in Rust was publicly shared by Jarred on X, where he reported that the new implementation passes 99.8% of the standard test suite used for Bun. This high pass rate indicates that the Rust version is nearly fully compatible with the original JavaScript runtime, a notable achievement given the complexity of such systems.

The original Bun runtime is designed to optimize JavaScript and TypeScript performance, and rewriting it in Rust aims to enhance speed, safety, and stability. While the project has not yet achieved 100% test pass, the 99.8% figure suggests that most core functionalities are operational, with some edge cases still under review. The tests cover a broad spectrum of runtime behaviors, including module loading, execution, and system calls, which are critical for real-world application compatibility.

Why It Matters

This milestone is significant because it demonstrates that a high-performance JavaScript runtime can be effectively reimplemented in Rust, a language known for safety and speed. If the project continues to improve and reach full compatibility, it could influence future JavaScript runtime development, potentially leading to faster, more secure environments for web and server-side applications. For the developer community, this also signals a shift toward exploring alternative implementations beyond traditional engines.

Amazon

JavaScript runtime performance optimization

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Bun is a relatively new JavaScript runtime that aims to provide faster startup and execution times compared to existing engines like Node.js and Deno. The project has gained attention for its performance claims and modern architecture. Rewriting Bun in Rust is part of broader efforts to improve runtime efficiency and safety, with Jarred’s work representing a significant technical challenge. Prior to this, Bun was primarily implemented in JavaScript and C++, and this rewrite attempts to leverage Rust’s advantages for systems programming.

“We’re not being ambitious enough”

— Jarred

“Passing 99.8% of the tests is a major milestone, but some edge cases still need addressing.”

— Unnamed source familiar with the project

Amazon

Rust programming language books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how the remaining 0.2% of tests will be passed or what specific functionalities are still failing. The timeline for achieving complete compatibility and the final performance benchmarks are still uncertain. Additionally, the impact of this rewrite on Bun’s adoption and real-world performance remains to be seen as further testing and optimization continue.

Amazon

JavaScript runtime testing tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Next steps include addressing the remaining test failures, optimizing performance, and conducting real-world testing to validate stability. The project team may also release updated versions and seek community feedback to refine the implementation. Monitoring progress toward full test suite pass rate and performance benchmarks will be key in the coming months.

Amazon

server-side JavaScript development tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is Bun, and why is rewriting it in Rust important?

Bun is a JavaScript runtime designed for high performance, and rewriting it in Rust aims to improve speed, safety, and stability, potentially setting new standards for JavaScript execution environments.

What does passing 99.8% of tests mean for the project?

It indicates that the Rust version is nearly fully compatible with the original, with most functionalities working correctly, though some edge cases remain unresolved.

When might the Rust version of Bun be ready for production use?

It is too early to determine a timeline; further testing, optimization, and bug fixing are needed before considering production deployment.

How does this development affect the broader JavaScript ecosystem?

If successful, the Rust rewrite could influence future runtime designs, encouraging more systems-level improvements and alternative implementations for JavaScript environments.

You May Also Like

Show HN: adamsreview – better multi-agent PR reviews for Claude Code

A new plugin, adamsreview, enhances multi-agent code review workflows for Claude Code, improving bug detection and automation in pull request processes.

How Fast Does Claude, Acting as a User Space IP Stack, Respond to Pings?

Researchers tested how quickly Claude, acting as a user space IP stack, responds to ICMP pings, revealing insights into LLM-based network emulation performance.