Zig course

Zig Level 7: Modules & Build System

Modules & Build System is level 7 of 11 of the LoWisa Zig course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-25

Modules

  • Files as structs. A Zig file is a struct: @import returns it, and its pub declarations are the API.
  • @import. @import wires modules: std, dependencies and your files, one mechanism.
  • Visibility. pub marks what leaves a file: everything else private by default.

Zig Build

  • build.zig. The build system is Zig itself: build.zig scripting compilation as code.
  • Build steps. Builds declare steps: executables, tests, options: a build graph, not a config file.
  • Package manager. Dependencies pin by hash in the manifest: reproducible builds by construction.

Dependencies and Cross Compilation

  • Cross targets. A target flag builds for any platform: musl Linux from Windows, ARM from x86.
  • Vendoring C. Zig builds can compile C dependencies directly: one build graph, both languages.
  • Small dependency culture. Zig culture keeps dependencies few: the standard library first, always.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Zig Level 7: Modules & Build System cover?

Modules, Zig Build, Dependencies and Cross Compilation: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 6: Comptime, which covers Compile-Time Evaluation, Generic Programming, Compile-Time Code Generation.

Learn Zig on your phone

The first level is free. LoWisa is on Google Play and the App Store.