How Our Rust-to-Zig Rewrite Is Going

rtfeldman.com
July 16, 2026
31 min read
🔥🔥🔥🔥🔥
68/100
Summary
Roc's compiler team has rewritten 300,000 lines of Rust code into Zig over the past year and a half. The project has achieved feature parity with the original Rust compiler.
Key Takeaways
- The Roc team has rewritten 300,000 lines of Rust code into Zig, achieving feature parity with the original compiler.
- The updated Rocci Bird game now runs with a 31KB WebAssembly binary, significantly smaller than the original compiler's output.
- The rewrite process took 487 days, which was 476 days longer than a similar project that transitioned from Zig to Rust.
- The new compiler allows users to write and run basic Roc programs directly from the roc-lang.org homepage via a 2.5MB WebAssembly binary.
Coverage & discussions
Hacker News · rtfeldman.com
Community discussions
Hacker News discussion ↗
Historical count: 5 · 5 saved in sample · Historical sample
Analysis ready
Community Sentiment
Positives
- Zig's incremental builds are definitely a killer feature — they could be a game-changer for developers looking to speed up their workflows.
- Some commenters are optimistic about Rust potentially adopting Zig's features in the future, which could combine the best of both worlds.
- There's interest in building tools that merge Rust's safety with Zig's performance, highlighting a desire for innovation in the compiler landscape.
Concerns
- Many skeptics doubt that Zig's safety features actually catch use-after-free errors, suggesting it might not be as robust as claimed.
- Commenters are critical about the lack of scientific evidence in choosing Zig over other languages, implying the decision may have been hasty or unfounded.
- There are concerns that simply rewriting in Zig won't automatically yield better performance, as compiler efficiency heavily relies on algorithms, not just the language used.




