







Achieving polymorphism via dynamic dispatch in Zig
Interfaces, or: Runtime Polymorphism in Zig
Update: May 2023 - Killian Vounckx wrote an update to this (in February 2022) that covers some changes to Zig's idioms around how this stuff works. This page is just staying up for posterity.
We have Traits at Home | Mesoloop
I have had more time recently to write code in Zig[1], and it has been good for my soul. I wanted to share some insights I have arrived at regarding abstractions in Zig, including some techniques that I have found useful but not seen employed more broadly.
0.9.0 Release Notes ⚡ The Zig Programming Language
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
0.15.1 Release Notes ⚡ The Zig Programming Language
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
Inside Zig's Incremental Compilation
As a member of the Zig core team, one of the most impactful projects I’ve been involved with is the implementation of incremental compilation into the Zig compiler. This feature allows the compiler to detect which individual functions and declarations have changed since a project was last built, recompile only that code, and directly patch the resulting bytes into the output binary, making the rebuild extremely fast.
Leveraging Zig's Allocators
How Zig's allocators can help manage memory and improve performance
Why Zig When There is Already C++, D, and Rust? ⚡ Zig Programming Language
If Zig code doesn’t look like it’s jumping away to call a function, then it isn’t. This means you can be sure that the following code calls only foo() and then bar(), and this is guaranteed without needing to know the types of anything:
mht.wtf
Let's talk about comptime in Zig. comptime is the feature that allow you to run code at compile time, and is maybe Zig's biggest differentiator from other languages in the same space. Combined with having types as values we get both type specializaton, generics, reflection, and even code generation.
How Our Rust-to-Zig Rewrite is Going
For the past year and a half, the team building Roc's compiler has been rewriting our 300,000 lines of Rust code into Zig, for reasons I'll recap below. We recently passed an exciting milestone: feature parity with the original compiler!
Andrew Kelley: A Practical Guide to Applying Data Oriented Design (DoD)
Systems Programming with Zig
Zig delivers performance, reliability, and complex integration in systems programming in a simple, modern package. Zig hits the sweet spot for systems programming. This new programming language is high-performance, low-level, ultra-reliable, and perfectly suited for serious projects like writing libraries, daemons and shell utilities, and even operating systems and embedded code. Systems Programming with Zig shows you how to write quality, useful Zig applications without relying on libraries or frameworks-even if you’re new systems programming. In Systems Programming with Zig you’ll learn how to: Understand the Zig perspective on systems programming Write idiomatic Zig code Integrate Zig with C, systems libraries, and scripting languages Networking, interpreters, and graphics from the ground up Unlike UI-centric applications that form the public face of your software, systems programs like OS kernels, device drivers, and utilities interact directly with the hardware or operating system. In these low-level programs, performance and safety are paramount. Zig is a new programming language that builds on the legacy of C, C++, and even Rust to provide a high-productivity systems programming environment that does not rely on awkward libraries and frameworks.

Allocgate is coming in Zig 0.9, and you will have to change your code — Christine's World Wide Web Site
Version 0.9 of the Zig programming language is planned to release in about a week. One of the major changes coming in this release is a restructuring of how allocators work, which has been termed Allocgate. This is a breaking change to the Allocator API provided by the standard library, so pretty much any code that uses allocators will have to be updated in response. I hope to use this article to explain the justification for this change and what steps you need to take to adjust your code.
ZML - Model to Metal
ZML is a production inference stack, purpose-built to decouple AI workloads from proprietary hardware.