Get AI summaries of any video or article — Sign up free
P99 CONF - Zig vs Rust thumbnail

P99 CONF - Zig vs Rust

The PrimeTime·
5 min read

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.

TL;DR

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?

Rust is described as the “safe and boring choice” because systems programming has few viable options, and memory safety is treated as the foundation for reliable infrastructure. Pekka cites adoption and legitimacy signals—millions of developers, plus Rust being used in the Linux kernel and worked on by Microsoft—to argue Rust is already accepted for performance-critical systems work.

What makes Zig’s approach feel more predictable to the panelists?

Zig is characterized as having no hidden behavior: no operator overloading, and no constructors/destructors that can run implicitly. That predictability is paired with performance focus and “as much safety as you can get out of the box,” but the tradeoff is that developers may need to use lower-level patterns and comptime more heavily.

What’s the core complaint about Zig’s comptime, and what’s the counterargument?

The complaint is that comptime can feel like “magic” and can spread everywhere, making code harder to reason about—Pekka describes a months-long Zig effort where comptime ended up pervasive. The counterargument is that comptime is idiomatic and powerful: Jared points to Bun generating lookup tables at compile time for decoding variable-length integers used in source maps, and argues comptime can replace hacky build scripts and parts of the build system.

How do the panelists say Zig is learned effectively?

Jared says learning is largely done by reading lots of code—especially Zig’s standard library and system-call usage—then using man pages and experimenting. He also credits Zig Discord as a major accelerant, saying he likely would have given up without the community’s help.

What’s the debate about distribution and portability between Rust and Zig?

Globber argues Zig’s generated binaries are more self-contained and easier to distribute across environments, while Rust distribution can get complicated when dependencies require shared libraries (e.g., SSL), leading to symbol resolution and build complexity. Jared replies that Rust distribution is not impossible, but portability/performance tradeoffs still appear early and frequently when code needs platform-specific optimizations.

How does Zig handle “interfaces,” and why does that matter for people coming from Rust/Go?

Zig has no built-in interfaces in the same way; the panel describes creating your own V-table and manually wiring function calls and pointers. The discussion suggests this is a real friction point for developers used to interface-based design, with the expectation that language and tooling may improve, but for now many solutions rely on comptime patterns (like passing types as parameters) and may reduce autocomplete quality.

Review Questions

  1. When does comptime in Zig become a productivity win rather than a source of “magic,” according to the panelists?
  2. What specific reasons are given for Rust being “safe and boring” for infrastructure work?
  3. How do the panelists connect distribution complexity to dependency choices (e.g., shared libraries) when comparing Rust and Zig?

Key Points

  1. 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. 2

    Zig is positioned as more predictable for low-level work because it avoids hidden behavior such as constructors/destructors and operator overloading.

  3. 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. 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. 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. 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. 7

    Systems-language “approachability” is discussed through Mojo’s Python-like syntax, but skepticism remains about replacing Python broadly outside machine learning.

Highlights

Rust is framed as the “safe and boring” infrastructure choice because memory safety is treated as the base layer for reliable systems software.
Zig’s strongest pitch is explicit control: no hidden behavior, no constructors/destructors, and a willingness to use comptime for code generation and build replacement.
The comptime argument turns on maintainability: it can become pervasive “magic,” or it can replace brittle build scripts with generated, readable artifacts.
Portability isn’t just about cross-compiling—it’s about what ends up inside the shipped binary, especially when shared libraries like SSL enter the dependency graph.
Interface ergonomics in Zig remains a sticking point, pushing developers toward manual V-table patterns or comptime-based type tricks.

Topics

  • Rust vs Zig
  • Comptime Code Generation
  • Memory Safety
  • Binary Distribution
  • Interfaces and V-Tables

Mentioned

  • Michael Stonebreaker
  • Brian Cantril
  • Andy Palvo
  • Gunner Morling
  • Pekka
  • Globber Costa
  • Jared
  • Chris Ladner