| How Our Rust-to-Zig Rewrite Is Going(rtfeldman.com) | |
| 502 points by jorangreef 23 hours ago | 267 comments | |
tl;dr: The Roc team rewrote their 300K-line compiler from Rust to Zig over 18 months, hitting feature parity and gaining benefits like hot code loading, zero-parse deserialization, and eventually ~35ms incremental builds (vs Rust's 3.4s). Memory safety concerns proved overblown: only 2 use-after-free bugs occurred in the Zig compiler itself, both minor. Key reasons for choosing Zig included better memory allocator control, faster builds, and access to Zig's LLVM bitcode serializer, though they miss Rust's borrow checker, private fields, and backwards-compatibility guarantees. | |
HN Discussion:
| |