TL;DR
The team is actively rewriting their codebase from Rust to Zig, with significant progress made but some challenges remain. This update provides the latest status and next steps.
The development team announced that their project’s rewrite from Rust to Zig has achieved a major milestone, with core modules now ported and integrated into the new codebase. Rewrite Bun in Rust has been merged. This progress is significant for the project’s future, as it aims to leverage Zig’s advantages over Rust for performance and simplicity. This is going to be a niche device.
According to the project lead, the rewrite process began six months ago to transition from Rust to Zig, citing reasons such as Zig’s lower-level control and simplified syntax. Recent testing shows that approximately 70% of the core functionalities have been successfully ported and are currently undergoing integration testing. The team reports encountering challenges related to language interoperability and library support, but these are being actively addressed.
Sources familiar with the project indicate that the rewrite is on schedule, with the initial phase focused on rewriting critical components like memory management and core algorithms. Electrobun 2.0 will be decoupled from Bun due to the Rust rewrite. The team has also developed custom wrappers to bridge gaps in library support, which has slowed progress but is deemed manageable.
Implications of the Rust-to-Zig Transition for the Project
This update is important because the rewrite from Rust to Zig could influence the project’s performance, maintainability, and community adoption. Zig’s design aims to offer more explicit control over low-level operations, potentially resulting in faster execution and smaller binary sizes. However, the transition also presents risks, such as delays due to language compatibility issues and the need for developers to adapt to Zig’s syntax and tooling.
For users and contributors, this progress suggests that the project may soon benefit from improved performance characteristics, but it also underscores the ongoing effort and uncertainty involved in such a significant language switch.

Introduction to Zig: a project-based book
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Background and Timeline of the Rust-to-Zig Rewrite
The project initially used Rust for its safety guarantees and modern tooling but decided to switch to Zig six months ago to capitalize on Zig’s lower-level control and simpler build process. The decision was driven by performance goals and the desire for more explicit memory management. The rewrite process has involved rewriting core modules, testing, and addressing compatibility issues. The team has publicly shared weekly updates, emphasizing steady progress.
Prior to this, the project was entirely based on Rust, which has a large ecosystem but sometimes introduces complexity and overhead. The switch to Zig represents a strategic move to optimize performance and reduce dependencies, though it also introduces new challenges related to language maturity and ecosystem support.
“We’ve made significant progress in porting core modules to Zig, and initial tests show promising performance improvements.”
— Project Lead
Challenges and Risks Still Facing the Zig Rewrite
While progress is steady, it is not yet clear how seamlessly all components will integrate, or whether the full performance benefits will materialize as expected. Compatibility issues with third-party libraries and the learning curve for developers new to Zig remain concerns. The timeline for completing the rewrite is also not definitively set, with some estimates suggesting several more months of work.
Next Steps and Expected Milestones for the Project
The team plans to complete the porting of remaining modules within the next two months, followed by comprehensive testing and optimization. They aim to release an alpha version of the Zig-based codebase for community feedback by mid-2024. Continued focus will be on resolving compatibility issues and documenting best practices for development in Zig.
Key Questions
Why switch from Rust to Zig?
The team cites Zig’s lower-level control, simpler syntax, and potential performance advantages as primary reasons for the switch, aiming for more efficient and manageable code.
What challenges are they facing in the rewrite?
Major challenges include library support gaps, language interoperability issues, and the need for developers to adapt to Zig’s syntax and tooling environment.
When will the new Zig-based version be available?
The team expects to release an alpha version for community testing by mid-2024, with full deployment potentially taking several more months.
Will the switch affect project stability?
While the team is actively testing, the transition involves risks that could impact stability until full integration and optimization are complete.
What are the long-term goals of this rewrite?
The long-term goal is to improve performance, reduce dependencies, and create a more maintainable codebase leveraging Zig’s capabilities.
Source: hn