| Chapter | Title | Description |
|---|---|---|
| 1 | Part 1. Introduction and Setup | Zig is a programming language for writing fast, small, reliable programs. |
| 2 | Part 2. Zig Language Fundamentals | A program stores values so it can use them later. In Zig, you store values with two main keywords: |
| 3 | Part 3. Control Flow | Programs need to make choices. |
| 4 | Part 4. Functions | Functions are reusable blocks of code. |
| 5 | Part 5. Error Handling | Most programming languages need a way to handle failure. |
| 6 | Part 6. Pointers and Memory | Memory is where a program keeps its data while it runs. |
| 7 | Part 7. Arrays, Slices, and Strings | An array is a group of values stored next to each other. |
| 8 | Part 8. Structs, Enums, and Unions | A struct is a type that groups several values together. |
| 9 | Part 9. Optionals and Advanced Types | An optional type is a type that can hold either a value or no value. |
| 10 | Part 10. Compile-Time Programming | comptime means “compile time.” |
| 11 | Part 11. Zig Builtins | Zig has special built-in functions whose names start with @. |
| 12 | Part 12. Allocators and Memory Management | Memory is one of the most important ideas in Zig. |
| 13 | Part 13. Collections and Data Structures | An ArrayList is one of the most important data structures in Zig. |
| 14 | Part 14. The Standard Library | std is Zig’s standard library. |
| 15 | Part 15. Build System and Tooling | Zig has a built-in build system. |
| 16 | Part 16. Testing and Debugging | Zig has a built-in test system. You do not need a separate testing library to start writing tests. |
| 17 | Part 17. Interfacing with C | Zig works unusually well with C because it treats C as a first-class part of systems programming. |
| 18 | Part 18. Concurrency and Async | A thread is a separate path of execution inside one program. |
| 19 | Part 19. Systems Programming | A memory mapped file is a file that the operating system places into your program’s address space. |
| 20 | Part 20. Performance and Optimization | Performance is one of the main reasons people choose Zig. |
| 21 | Part 21. Advanced Zig | Zig has a formatting system built into the standard library. You have already used it many times through std.debug.print. |
| 22 | Part 22. Cross-Platform Development | Windows is one of Zig’s main supported platforms. You can write Zig programs on Windows, build Windows executables, call Windows system APIs, link with C libraries, and… |
| 23 | Part 23. Real Projects | In this project, we will build a small command-line calculator. |
| 24 | Part 24. Reading and Contributing to Zig | The Zig compiler is not only a compiler for the Zig language. It is also the center of the Zig toolchain. |
| Appendix | Appendix | Zig is a programming language for writing fast, small, reliable programs. |
Part 1. Introduction and SetupZig is a programming language for writing fast, small, reliable programs.
Part 2. Zig Language FundamentalsA program stores values so it can use them later. In Zig, you store values with two main keywords:
Part 3. Control FlowPrograms need to make choices.
Part 4. FunctionsFunctions are reusable blocks of code.
Part 5. Error HandlingMost programming languages need a way to handle failure.
Part 6. Pointers and MemoryMemory is where a program keeps its data while it runs.
Part 7. Arrays, Slices, and StringsAn array is a group of values stored next to each other.
Part 8. Structs, Enums, and UnionsA struct is a type that groups several values together.
Part 9. Optionals and Advanced TypesAn optional type is a type that can hold either a value or no value.
Part 10. Compile-Time Programmingcomptime means “compile time.”
Part 11. Zig BuiltinsZig has special built-in functions whose names start with @.
Part 12. Allocators and Memory ManagementMemory is one of the most important ideas in Zig.
Part 13. Collections and Data StructuresAn ArrayList is one of the most important data structures in Zig.
Part 14. The Standard Librarystd is Zig’s standard library.
Part 15. Build System and ToolingZig has a built-in build system.
Part 16. Testing and DebuggingZig has a built-in test system. You do not need a separate testing library to start writing tests.
Part 17. Interfacing with CZig works unusually well with C because it treats C as a first-class part of systems programming.
Part 18. Concurrency and AsyncA thread is a separate path of execution inside one program.
Part 19. Systems ProgrammingA memory mapped file is a file that the operating system places into your program's address space.
Part 20. Performance and OptimizationPerformance is one of the main reasons people choose Zig.
Part 21. Advanced ZigZig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
Part 22. Cross-Platform DevelopmentWindows is one of Zig’s main supported platforms. You can write Zig programs on Windows, build Windows executables, call Windows system APIs, link with C libraries, and...
Part 23. Real ProjectsIn this project, we will build a small command-line calculator.
Part 24. Reading and Contributing to ZigThe Zig compiler is not only a compiler for the Zig language. It is also the center of the Zig toolchain.
AppendixZig is a programming language for writing fast, small, reliable programs.