P99 CONF - Zig vs Rust
Based on The PrimeTime's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Rust is positioned as a memory-safety-first default for infrastructure, with legitimacy reinforced by adoption signals like Linux kernel and Microsoft involvement.
Briefing
The central takeaway from this P99 CONF panel is a practical split between Rust and Zig for systems and high-performance work: Rust is framed as the “safe and boring” default for infrastructure thanks to memory safety and broad ecosystem momentum, while Zig is pitched as the language of choice when developers want maximum control with fewer hidden behaviors—even if that means leaning harder on compile-time code generation.
Pekka (Turo) makes the Rust case around memory safety and infrastructure readiness. He argues that systems programming leaves few viable options, and that Rust’s approach has helped it move from niche to mainstream enough to be used in major environments, including Linux kernel work and Microsoft efforts. He also cites adoption stats—roughly 7 million C++ developers versus 1–2 million Rust developers—to support the claim that Rust is already “accepted” for building critical software. In his framing, Rust’s value is less about novelty and more about reducing catastrophic failure modes while still fitting the needs of performance-focused infrastructure.
Jared (Bun) counters with Zig, emphasizing predictability: no hidden behavior, no operator overloading, and no constructors/destructors that can obscure what runs when. Zig’s appeal, he says, is control “down to the details,” paired with safety features available out of the box. The panel then drills into Zig’s compile-time (comptime) as the flashpoint. Pekka describes comptime as something he struggled to understand and ended up using “everywhere” during a months-long Zig project, calling it a rabbit hole of magic. He contrasts that with the idea that macros in other languages are usually constrained, whereas comptime can propagate widely.
Jared pushes back: comptime is not just for types—it also replaces parts of the build system and enables maintainable code generation. He gives a concrete Bun example: generating a lookup table at compile time for decoding variable-length integers used in source maps (base64-related line/column mapping). He also argues that comptime is idiomatic for Zig’s strengths, while acknowledging that overuse can create problems—just like overusing allocations can.
The discussion shifts to learning and tooling. Zig’s resources are described as sparse, and early experience can feel like “fighting the compiler,” though that pain fades as developers learn the language’s limited error patterns. Jared says he learned largely by reading Zig’s standard library and system-call documentation, plus leaning on Zig Discord for fast answers. On developer experience, the panelists compare Rust’s borrow-checker learning curve and compile-time costs to Zig’s faster compilation, while noting that modern Rust tooling (e.g., editor diagnostics) can reduce day-to-day friction.
Finally, the panel addresses distribution and portability. Globber (Turo) argues Zig’s ability to generate self-contained binaries simplifies shipping across platforms, while Rust distribution can become complicated when dependencies pull in shared libraries (e.g., SSL). Jared responds that Rust isn’t “impossible,” but portability tradeoffs show up early and repeatedly—especially when performance work forces platform-specific implementations. The panel closes by debating interfaces/traits in Zig (hand-rolled vtables and comptime-based patterns) and by looking forward to systems-language trends, including Mojo’s Python-like syntax aimed at performance, with skepticism about replacing Python beyond machine learning.
Overall, the conversation lands on a clear decision framework: choose Rust when you want a mature, safety-first ecosystem for infrastructure; choose Zig when you want explicit control and are willing to embrace comptime and lower-level patterns to get predictable performance and simpler distribution artifacts.
Cornell Notes
Rust is presented as the “safe and boring” systems choice, grounded in memory safety and growing acceptance in infrastructure work (including Linux kernel and Microsoft efforts). Zig is pitched as the language for maximum control with fewer hidden behaviors, where compile-time code generation (comptime) becomes a core tool rather than a workaround. The panelists debate comptime’s learning curve—some find it magical and hard to reason about, while others show how it replaces build scripts and enables maintainable code generation. Learning Zig is described as code-reading heavy (standard library, system calls) with community support (Discord). The practical stakes include distribution: Zig’s self-contained binaries are argued to be easier to ship, while Rust can face dependency-driven complexity when shared libraries enter the picture.
Why does Rust get framed as the default for infrastructure software in this discussion?
What makes Zig’s approach feel more predictable to the panelists?
What’s the core complaint about Zig’s comptime, and what’s the counterargument?
How do the panelists say Zig is learned effectively?
What’s the debate about distribution and portability between Rust and Zig?
How does Zig handle “interfaces,” and why does that matter for people coming from Rust/Go?
Review Questions
- When does comptime in Zig become a productivity win rather than a source of “magic,” according to the panelists?
- What specific reasons are given for Rust being “safe and boring” for infrastructure work?
- How do the panelists connect distribution complexity to dependency choices (e.g., shared libraries) when comparing Rust and Zig?
Key Points
- 1
Rust is positioned as a memory-safety-first default for infrastructure, with legitimacy reinforced by adoption signals like Linux kernel and Microsoft involvement.
- 2
Zig is positioned as more predictable for low-level work because it avoids hidden behavior such as constructors/destructors and operator overloading.
- 3
Comptime is debated: critics see it as hard-to-reason-about magic that can spread widely, while proponents argue it enables maintainable code generation and can replace build-system logic.
- 4
Learning Zig is described as code-intensive (standard library and system-call reading) and community-assisted (Zig Discord), with early “compiler fighting” improving over time.
- 5
Distribution and portability are treated as practical decision factors: Zig’s self-contained binaries are argued to simplify shipping, while Rust can face dependency-driven complexity when shared libraries are involved.
- 6
Interface/trait ergonomics are a known friction point in Zig for developers used to Go/Rust patterns, often requiring manual V-table-style designs or comptime-based workarounds.
- 7
Systems-language “approachability” is discussed through Mojo’s Python-like syntax, but skepticism remains about replacing Python broadly outside machine learning.