Zig by Example

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal and reusable software. Be advised Zig has not yet reached the 1.0 release. Please read the official documentation to learn more.

Zig by Example is a clone of Go by Example and follows the same ethos: being a hands-on introduction to Zig using annotated example programs. Check out the first example or browse the full list below.

Unless stated otherwise, examples here assume the latest 0.X release of Zig and may use new language features. Try to upgrade to the latest version if something isn't working.

A note from the author of the zig examples: read