How the machine works, then how Zig lets you drive it.
Part I is the machine model every systems language assumes. Part II is Zig, which exposes that model instead of hiding it.
The machine
8 lessonsBits, bytes & integers
Everything is a pattern of bits. The type decides what the pattern means.
Memory, addresses & layout
Memory is one long array of bytes. Endianness, alignment and padding decide where yours go.
The CPU & instructions
Registers, the fetch-decode-execute loop, and reading the assembly your code turns into.
The stack & calling conventions
How function calls really work: frames, return addresses and the registers everyone agrees on.
The heap & allocation
Where long-lived memory comes from, how allocators work, and the bugs they invite.
Caches & locality
Why the same loop can run ten times faster just by touching memory in a different order.
Virtual memory
Every process thinks it owns the whole address space. Page tables make the illusion work.
Syscalls & the kernel
The one door between your program and the hardware, and how to knock on it directly.
Zig
6 lessonsZig fundamentals
Setup, const and var, types as values, and the four build modes.
Pointers & slices
Single, many and fat pointers, sentinel-terminated strings, and nullable pointers that cost nothing.
Errors, optionals & defer
Errors are values you must handle, and defer keeps cleanup next to acquisition.
Allocators in Zig
No hidden allocations: every function that allocates says so, and you choose the strategy.
comptime & generics
One feature replaces macros, templates and generics: running ordinary Zig at compile time.
C interop & bit-level layout
Call C directly, export to C, pack bits exactly, and poke hardware registers.