Download Latest Version v1.5.1 source code.tar.gz (9.2 MB)
Email in envelope

Get an email when there's a new version of Introduction to Zig

Home / v1.5.1
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-11-28 1.6 kB
v1.5.1 source code.tar.gz 2025-11-28 9.2 MB
v1.5.1 source code.zip 2025-11-28 9.4 MB
Totals: 3 Items   18.6 MB 15

In this release we've added a build script (build.zig) to the ZigExamples folder. With this build script you can quickly compile all Zig modules (more specifically, the ones that are meant to be successfully compiled) written inside the ZigExamples subfolders. To run this script, do these steps:

:::bash
$ cd ZigExamples
$ zig build

Is important to emphasize that not all Zig modules written inside the ZigExamples subfolder are included into this build script. Specially because not all of these Zig modules are meant to be "compileable". Some of them, are examples of "broken programs" (kinda Ziglings-style).

The main objective of this build script is to be a second "weapon", or, a second strategy that we can use to determine if the current code examples exposed in the book can be successfully compiled by the latest version of the Zig compiler. In more details, sometimes inside the book, I expose some code snippets that are not "self-contained", meaning that, they need some extra code around them to actually form a valid Zig program. I mostly do that in the book for brevity purposes (is unnecessary to expose the same code multiple times to the reader). Because of that, these code snippets that are not "self-contained" are usually not compiled when we build the book. Since we don't actively compile them, we don't get an active and frequent status/feedback on whether they are still valid (or not) snippets of Zig code, on the latest version of the compiler. As consequence, they can be easily overlooked in the book's updates process.

Therefore, this build script can help us on solving this issue.

Source: README.md, updated 2025-11-28