Types and Values
- Explicit integers. Zig integers say their width: u8, i32, u64: and arbitrary widths like u7 when hardware asks.
- const and var. const binds immutably, var mutably: immutability the visible default.
- No implicit coercions. Numeric conversions are explicit: @intCast and friends, every narrowing a visible decision.
Control Flow
- if and switch. Zig branches with if and switch: switch exhaustive over enums, checked by the compiler.
- Loops. while and for iterate: for walking slices with index and value, no hidden iterators.
- defer. defer schedules cleanup at scope exit: release written beside acquire, run in reverse order.
Functions
- Functions. A fn declares typed parameters and return: pub exporting it beyond the file.
- Error unions in signatures. A return like !u32 means error-or-value: fallibility part of the type.
- No variadics magic. Zig passes tuples and comptime where others use variadics: printing included, checked at compile time.
Before and after this level
- Before: Start Here: Explicit Systems Programming: Zig's Design Philosophy, Native Compilation.
- Next: Level 2: Pointers & Memory: Pointers, Slices, Memory Representation.
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 1: Zig Foundations cover?
Types and Values, Control Flow, Functions: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Start Here: Explicit Systems Programming, which covers Zig's Design Philosophy, Native Compilation.