⚡ Zig Guide LiveUnofficialbut fully verified
✓ Zig 0.17.0-dev.1503+1f1bee62eOn an older Zig?

The Guide

145 chapters in four tracks. They read in this order, and the arrows at the foot of every page follow it, so you can start at the top and never choose again. Each track also stands on its own if you already know the language.

Start with Installation → or pick a reading path for where you are coming from.

Foundations

The language and the library it ships with. Start here.

  • Getting StartedInstall a Zig master build, compile and run your first program, run tests, and catch up on what changed since the last tagged release.
  • LanguageZig language chapters you can run: integers, floats, pointers, slices, optionals, error unions, structs, unions, enums, switch, loops, comptime and vectors.
  • Standard LibraryZig std by example: allocators, ArrayList, hash maps, JSON, the Io interface, readers and writers, threads, crypto, formatting and sorting.
  • Data StructuresBuilding containers in Zig: a linked list with an allocator you own, generic containers as comptime type functions, the intrusive lists std actually ships, a binary search tree, AVL rotations, and a hash map with open addressing.

Systems

Zig against the world outside the process: networks, builds, C, wasm, and pixels.

  • NetworkingNetwork programming in Zig from the socket up: message framing, short reads, text and binary protocols, byte order, serving many clients through std.Io, TCP, UDP and HTTP.
  • Build Systembuild.zig by example: build modes, cross-compilation, declaring dependencies in build.zig.zon, and generating documentation.
  • Working with CCalling C from Zig and exposing Zig to C: @cImport and translate-c, C pointer types, C primitive types, and the C ABI.
  • WebAssemblyCompiling Zig to WebAssembly: freestanding modules, calling Zig from JavaScript, passing data across the boundary, loading wasm in the browser, and building a WASI command.
  • GraphicsSoftware rendering and image processing in Zig with no graphics library: framebuffers, rasterizing lines, circles and triangles, alpha blending, antialiasing, brightness and contrast, gaussian blur, Sobel edges, colour matrices, histogram equalization, median filters, and image scaling.

Cookbook

Task-shaped recipes, each a complete program CI compiled and ran.

  • How-ToA Zig cookbook of runnable recipes: JSON, SQLite, the PostgreSQL wire protocol, Redis RESP, threads and atomics, SIMD, compression and binary formats.

Projects

One library at a time, designed in the open, one decision per chapter.

  • An Ecto-Style ORMAn Ecto-style ORM in Zig: schemas as types, a typed query builder, migrations as data, transactions with errdefer, and an adapter seam over SQLite and PostgreSQL.