| Chapter | Title | Description |
|---|---|---|
| 1 | Chapter 1. Hello, Zig | The first program in Zig is small. |
| 2 | Chapter 2. Names and Declarations | A Zig program is made from declarations. |
| 3 | Chapter 3. Blocks are Expressions | A block is a sequence of statements inside braces. |
| 4 | Chapter 4. Defining Functions | A function groups statements into a single operation. Functions are the basic unit of organization in a Zig program. |
| 5 | Chapter 5. Addresses and Pointer Types | A variable has a value. In Zig, a variable may also have an address. |
| 6 | Chapter 6. Fixed-Size Arrays | An array is a sequence of values of the same type. |
| 7 | Chapter 7. Struct Declarations | A struct is a type made from named fields. |
| 8 | Chapter 8. Error Sets | Programs fail for many reasons. A file may not exist. Memory allocation may fail. Input may be malformed. A network connection may close unexpectedly. |
| 9 | Chapter 9. The Optional Type | Sometimes a value may or may not exist. |
| 10 | Chapter 10. What comptime Means | A Zig program runs in two stages. |
| 11 | Chapter 11. Generic Functions | A function in Zig can take types as parameters. |
| 12 | Chapter 12. Why Allocation Is Explicit | A program uses memory to store values. |
| 13 | Chapter 13. Files | Most programs spend their time moving bytes. |
| 14 | Chapter 14. std.debug | The std.debug module contains utilities for debugging programs. The most commonly used function is print, which writes formatted output to standard error. |
| 15 | Chapter 15. zig build | Large programs are rarely built with a single compiler command. |
| 16 | Chapter 16. Calling C | One of Zig’s design goals is direct interoperability with C. |
| 17 | Chapter 17. Target Triples | One of Zig’s main design goals is cross compilation. |
| 18 | Chapter 18. Threads | A thread is an independent flow of execution. |
| 19 | Chapter 19. Undefined Behavior | Zig gives the programmer direct access to memory, integers, pointers, and machine operations. This makes many programs simple and efficient. It also makes some operations… |
| 20 | Chapter 20. A Command-Line Parser | Many programs begin the same way: they read command-line arguments, decide what the user requested, then execute an operation. |
| Appendix | Appendix | The first program in Zig is small. |
Chapter 1. Hello, ZigThe first program in Zig is small.
Chapter 2. Names and DeclarationsA Zig program is made from declarations.
Chapter 3. Blocks are ExpressionsA block is a sequence of statements inside braces.
Chapter 4. Defining FunctionsA function groups statements into a single operation. Functions are the basic unit of organization in a Zig program.
Chapter 5. Addresses and Pointer TypesA variable has a value. In Zig, a variable may also have an address.
Chapter 6. Fixed-Size ArraysAn array is a sequence of values of the same type.
Chapter 7. Struct DeclarationsA struct is a type made from named fields.
Chapter 8. Error SetsPrograms fail for many reasons. A file may not exist. Memory allocation may fail. Input may be malformed. A network connection may close unexpectedly.
Chapter 9. The Optional TypeSometimes a value may or may not exist.
Chapter 10. What `comptime` MeansA Zig program runs in two stages.
Chapter 11. Generic FunctionsA function in Zig can take types as parameters.
Chapter 12. Why Allocation Is ExplicitA program uses memory to store values.
Chapter 13. FilesMost programs spend their time moving bytes.
Chapter 14. `std.debug`The std.debug module contains utilities for debugging programs. The most commonly used function is print, which writes formatted output to standard error.
Chapter 15. `zig build`Large programs are rarely built with a single compiler command.
Chapter 16. Calling COne of Zig's design goals is direct interoperability with C.
Chapter 17. Target TriplesOne of Zig's main design goals is cross compilation.
Chapter 18. ThreadsA thread is an independent flow of execution.
Chapter 19. Undefined BehaviorZig gives the programmer direct access to memory, integers, pointers, and machine operations. This makes many programs simple and efficient. It also makes some operations...
Chapter 20. A Command-Line ParserMany programs begin the same way: they read command-line arguments, decide what the user requested, then execute an operation.
AppendixThe first program in Zig is small.