Skip to content

Zig

Zig book notes exported from ChatGPT, organized into 24 chapters.

ChapterTitleDescription
1Part 1. Introduction and SetupZig is a programming language for writing fast, small, reliable programs.
2Part 2. Zig Language FundamentalsA program stores values so it can use them later. In Zig, you store values with two main keywords:
3Part 3. Control FlowPrograms need to make choices.
4Part 4. FunctionsFunctions are reusable blocks of code.
5Part 5. Error HandlingMost programming languages need a way to handle failure.
6Part 6. Pointers and MemoryMemory is where a program keeps its data while it runs.
7Part 7. Arrays, Slices, and StringsAn array is a group of values stored next to each other.
8Part 8. Structs, Enums, and UnionsA struct is a type that groups several values together.
9Part 9. Optionals and Advanced TypesAn optional type is a type that can hold either a value or no value.
10Part 10. Compile-Time Programmingcomptime means “compile time.”
11Part 11. Zig BuiltinsZig has special built-in functions whose names start with @.
12Part 12. Allocators and Memory ManagementMemory is one of the most important ideas in Zig.
13Part 13. Collections and Data StructuresAn ArrayList is one of the most important data structures in Zig.
14Part 14. The Standard Librarystd is Zig’s standard library.
15Part 15. Build System and ToolingZig has a built-in build system.
16Part 16. Testing and DebuggingZig has a built-in test system. You do not need a separate testing library to start writing tests.
17Part 17. Interfacing with CZig works unusually well with C because it treats C as a first-class part of systems programming.
18Part 18. Concurrency and AsyncA thread is a separate path of execution inside one program.
19Part 19. Systems ProgrammingA memory mapped file is a file that the operating system places into your program’s address space.
20Part 20. Performance and OptimizationPerformance is one of the main reasons people choose Zig.
21Part 21. Advanced ZigZig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
22Part 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…
23Part 23. Real ProjectsIn this project, we will build a small command-line calculator.
24Part 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.
AppendixAppendixZig 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.
11 pages · 61 min
Part 2. Zig Language FundamentalsA program stores values so it can use them later. In Zig, you store values with two main keywords:
12 pages · 72 min
Part 3. Control FlowPrograms need to make choices.
10 pages · 67 min
Part 4. FunctionsFunctions are reusable blocks of code.
11 pages · 54 min
Part 5. Error HandlingMost programming languages need a way to handle failure.
10 pages · 61 min
Part 6. Pointers and MemoryMemory is where a program keeps its data while it runs.
12 pages · 101 min
Part 7. Arrays, Slices, and StringsAn array is a group of values stored next to each other.
10 pages · 81 min
Part 8. Structs, Enums, and UnionsA struct is a type that groups several values together.
10 pages · 74 min
Part 9. Optionals and Advanced TypesAn optional type is a type that can hold either a value or no value.
9 pages · 57 min
Part 10. Compile-Time Programmingcomptime means “compile time.”
10 pages · 65 min
Part 11. Zig BuiltinsZig has special built-in functions whose names start with @.
16 pages · 79 min
Part 12. Allocators and Memory ManagementMemory is one of the most important ideas in Zig.
10 pages · 60 min
Part 13. Collections and Data StructuresAn ArrayList is one of the most important data structures in Zig.
10 pages · 79 min
Part 14. The Standard Librarystd is Zig’s standard library.
15 pages · 115 min
Part 15. Build System and ToolingZig has a built-in build system.
11 pages · 67 min
Part 16. Testing and DebuggingZig has a built-in test system. You do not need a separate testing library to start writing tests.
10 pages · 64 min
Part 17. Interfacing with CZig works unusually well with C because it treats C as a first-class part of systems programming.
10 pages · 84 min
Part 18. Concurrency and AsyncA thread is a separate path of execution inside one program.
10 pages · 69 min
Part 19. Systems ProgrammingA memory mapped file is a file that the operating system places into your program's address space.
10 pages · 73 min
Part 20. Performance and OptimizationPerformance is one of the main reasons people choose Zig.
10 pages · 68 min
Part 21. Advanced ZigZig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
10 pages · 86 min
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...
9 pages · 66 min
Part 23. Real ProjectsIn this project, we will build a small command-line calculator.
11 pages · 87 min
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.
11 pages · 77 min
AppendixZig is a programming language for writing fast, small, reliable programs.
12 pages · 77 min