Reading paths
The guide has one order and the arrows at the foot of each page follow it. These are the shortcuts. Each one is a run of chapters that answers a particular starting point, and every link goes to the same chapter the sidebar does.
New to systems programming
You have written software, but never in a language that made you say where a value lives. Take the long way through the first two sections; this path is the spine of them.
- InstallationGetting Started
- Hello WorldGetting Started
- Running TestsGetting Started
- AssignmentLanguage
- ArraysLanguage
- If ExpressionsLanguage
- While LoopsLanguage
- For LoopsLanguage
- FunctionsLanguage
- DeferLanguage
- ErrorsLanguage
- PointersLanguage
- SlicesLanguage
- OptionalsLanguage
- StructsLanguage
- AllocatorsStandard Library
- ArrayListStandard Library
Then Data Structures, which makes you answer who frees what.
Coming from C
You already know pointers, the stack and undefined behaviour. Skip the tour and read the places Zig disagrees with C, then go straight at the interop.
- Hello WorldGetting Started
- Integer RulesLanguage
- Runtime SafetyLanguage
- PointersLanguage
- Many-item PointersLanguage
- SlicesLanguage
- Sentinel TerminationLanguage
- ErrorsLanguage
- DeferLanguage
- ComptimeLanguage
- AllocatorsStandard Library
- C Primitive TypesWorking with C
- C PointersWorking with C
- ABIWorking with C
- Importing CWorking with C
- Cross-compilationBuild System
Then the Cookbook, which is where the C you would have written shows up.
Coming from a garbage-collected language
Go, Java, C#, Python, JavaScript. The syntax will not be the hard part. Memory and error handling will, so this path front-loads both.
- Hello WorldGetting Started
- Running TestsGetting Started
- OptionalsLanguage
- ErrorsLanguage
- DeferLanguage
- PointersLanguage
- SlicesLanguage
- AllocatorsStandard Library
- Recipe: Catching Memory LeaksHow-To
- ArrayListStandard Library
- Hash MapsStandard Library
- StringsStandard Library
- ComptimeLanguage
- The Io InterfaceStandard Library
Then Concurrency, which is the other thing your old runtime was doing for you.
I want to ship something this week
You will read the language later. This is the shortest route to a program that reads input, does work, and writes a result.
- InstallationGetting Started
- Hello WorldGetting Started
- AllocatorsStandard Library
- ArrayListStandard Library
- Command-Line ArgumentsStandard Library
- FilesystemStandard Library
- JSONStandard Library
- Recipe: Loading a JSON ConfigHow-To
- Recipe: Word FrequenciesHow-To
- Zig BuildBuild System
- Build ModesBuild System
- Cross-compilationBuild System
Then pick the recipe that matches what you are building.
Writing a network service
A server, a client, or anything that speaks a protocol. The framing chapters are the ones that decide whether it survives contact with a real network, so they come before the sockets do most of the work.
- Readers and WritersStandard Library
- The Io InterfaceStandard Library
- What a Socket IsNetworking
- A TCP Round TripNetworking
- Bytes Have No EdgesNetworking
- Three Ways to FrameNetworking
- A Text Protocol, Both DirectionsNetworking
- Binary Protocols and Byte OrderNetworking
- Serving Many ClientsNetworking
- Failure Is OrdinaryNetworking
- Recipe: A Redis RESP Round TripHow-To
Then UDP and HTTP, or the PostgreSQL wire protocol for a bigger one.
Upgrading from an older Zig
Your code compiled on 0.13 or 0.14 and does not now. Read what moved, then the four areas that moved the most.
- Coming from an Older ZigGetting Started
- The Io InterfaceStandard Library
- Readers and WritersStandard Library
- FormattingStandard Library
- ArrayListStandard Library
- ArraysLanguage
Then re-run your own test suite against a master build.
None of these fit? The section list is the whole guide, and the first chapter of Getting Started leads through all of it.