
Richard Feldman’s team just hit feature parity on a 487-day rewrite of the Roc compiler — 300,000 lines of Rust, now Zig. Incremental rebuilds dropped from 3.4 seconds to 35 milliseconds on the upcoming Zig 0.17.0. That number hit Hacker News on July 16 and pulled 524 points and 90+ comments. The debate it reignited has actual data behind it, which is rare for a language-choice argument.
What Is Roc (and Why Should You Care)?
Roc is a statically-typed, purely functional language designed by Feldman — the author of Elm in Action — for application development across native, WASM, and beyond. It is pre-1.0, targeting a 0.1.0 release in late 2026. The compiler is the product, so build times are not just a developer experience complaint — they are the entire bet. You can read more about it at roc-lang.org.
The Build Time Numbers
Here is what Feldman measured on an Intel desktop running Ubuntu 26:
| Version | Lines of Code | Cold Build | Incremental |
|---|---|---|---|
| Rust 1.85.0 | 354K | 32.4s | 10.0s |
| Rust 1.97.0 | 354K | 25.4s | 3.4s |
| Zig 0.16.0 (stable) | 320K | 39.6s | 8.6s |
| Zig 0.17.0 (nightly) | 464K | 32.1s | 0.035s |
The 35ms number requires -fincremental in nightly Zig 0.17.0, which still has bugs blocking a stable release. The honest current picture is Zig 0.16.0 at 8.6 seconds incremental — still competitive with Rust when you account for the 31% larger codebase. The 35ms is a preview of what lands when 0.17.0 ships stable.
The Bug Count You Did Not Expect
Feldman used Claude to classify 3,027 bug reports across both compiler versions:
| Compiler | Memory Corruption Bugs | Other Bugs | Total |
|---|---|---|---|
| Rust compiler | 21 | 2,575 | 2,596 |
| Zig compiler | 10 | 421 | 431 |
Before you read this as “Zig is safer than Rust,” read the fine print. The 21 Rust “memory corruption” bugs were not bugs in the compiler — Rust’s borrow checker did its job there. They were miscompilations: bugs in the machine code the compiler generated for end-user programs. Language choice does not help you with those.
Of Zig’s 10 memory corruption bugs, 8 were also miscompilations. The remaining 2 were genuine use-after-frees in the Zig compiler itself — both in error reporting, affecting filename rendering. Feldman notes: “Rust’s borrow checker would have caught both.”
What the data actually shows: choosing Zig cost the team two memory-safety catches over 18 months of active compiler development. That is a real tradeoff. Whether it is acceptable depends entirely on your architecture.
Why Zig Fit Roc’s Architecture
Three things drove the decision, none of them ideology:
Allocator design. Roc uses arena allocators and struct-of-arrays memory layouts throughout. Rust’s ecosystem assumes one global allocator. Zig’s assumes granular, explicit allocator passing everywhere. The Zig version has zero friction where the Rust version had constant workarounds.
Unsafe pervasion. The original Rust compiler contained approximately 1,200 unsafe blocks — roughly one per 250 lines. Feldman’s argument: “if unsafe is going to be pervasive, it starts to sound more appealing to choose a language that’s safer than Unsafe Rust.” That is not a dismissal of Rust; it is an acknowledgment that Rust’s value proposition weakens when you cannot avoid unsafe anyway.
Ecosystem fit. The team needed LLVM bitcode serialization decoupled from breaking C++ library changes. Zig’s own compiler had that already.
The architectural payoff is real. Zero-parse deserialization — loading cached compiler data at memcpy speeds — only works with pointer-free data structures Zig naturally encourages. The rewrite also unlocked hot code loading during development and a pattern-matching syntax with string interpolation that performs zero heap allocations.
What Rust Does Better
Feldman is candid about the losses. He misses Rust’s Drop trait for automatic test cleanup, parametric polymorphism over Zig’s anyopaque casting, compile-time enforcement of private struct fields, and — critically — backwards compatibility. Zig pre-1.0 breaks APIs intentionally as the language evolves. Rust’s edition system made upgrades painless. That matters for a long-lived project.
The Takeaway
The Rust-versus-Zig framing is the wrong lens. This story is about a compiler team with specific, documented architectural requirements — arena allocators, pervasive unsafe code, compiler-specific LLVM tooling — finding that one language’s ecosystem was a better fit than the other’s. The data on build times and bug counts supports the decision, but the decision started with architecture, not benchmarks.
Rust is closing the build-speed gap; its 2026 roadmap targets faster incremental compilation explicitly. If Zig 0.17.0’s incremental builds had shipped six months earlier, this story might not exist. But the Roc team shipped a feature-complete compiler rewrite in 487 days. Read Feldman’s full writeup and the Hacker News discussion for the depth the numbers deserve.













