What you will learn in Systems Programming with Zig
Simple and safe applications, interpreters, and network services
Chapter by chapter
Chapter 1: Zig’s big ideas
The chapter introduction positions Zig as a systems language for builders and explains the projects and working habits it suits.
What you learn in chapter 1 →Chapter 2: A practical guide
The introduction frames Zig as a pragmatic language and explains why the book teaches basics before moving to practical projects.
What you learn in chapter 2 →Chapter 3: I/O with utility
Introduces cat as a simple, useful program and argues that dependable everyday software is a worthwhile use for Zig.
What you learn in chapter 3 →Chapter 4: Structuring programs, from REPL to webpage
The chapter introduces a word ladder game that will be built first as a REPL and then as a web application.
What you learn in chapter 4 →Chapter 5: A fabulous FFI cookbook
The chapter introduction frames a recipe-book library as a small, reliable solution to a time-pressed programming assignment.
What you learn in chapter 5 →Chapter 6: A CHIP-8 interpreter
The chapter introduces CHIP-8 as an interpreter project, explains why building interpreters is valuable, and defines bytecode.
What you learn in chapter 6 →Chapter 7: The baroque world of computer graphics
The chapter introduces hardware-accelerated graphics as a visible form of systems programming and explains why working with GPUs is demanding.
What you learn in chapter 7 →Concepts explained in this book
- ZigZig is a general-purpose systems programming language designed for reliable, maintainable, performant software with minimal dependencies and explicit control over low-level behavior.
- error setAn error set is the statically specified set of error values that a function may produce.
- comptimeComptime is Zig's compile-time execution feature that allows code to be evaluated during compilation.
- OpenGLOpenGL 3.3 Core is an OpenGL version and core profile specifying a standardized set of graphics-rendering functionality.
- iteratorThe iterator pattern provides an abstraction for accessing elements sequentially without exposing their underlying representation.
- error handlingError handling is the representation and handling of failures that can occur during program execution.
- build scriptA build script is a program or declarative specification that defines how source code and dependencies are configured and compiled.
- GLFWGLFW is a cross-platform library for creating windows and OpenGL contexts and handling input and related application events.
- data-oriented programmingData-oriented design organizes software around data representation, layout, access patterns, and transformations.
- C ABI compatibilityThe C ABI is the platform-specific binary interface convention commonly designed around the C language's stable data representation and expected by a computer system's operating system and CPU.
- std.Iostd.Io is Zig's standard-library interface for portable input/output operations, including buffered and concurrent I/O.
- program counterA program counter is a processor or virtual-machine state value that identifies the address of the next instruction to execute.
- CHIP-8The CHIP-8 instruction set is the collection of opcodes and execution semantics defined for the CHIP-8 virtual machine.
- ArenaArena allocation obtains storage from an arena and typically releases the storage collectively rather than freeing individual allocations.
- memory allocatorAn allocator is an abstraction that obtains and releases memory on behalf of program code.
- @import@import is a Zig builtin function and expression that loads Zig code from a module or file and returns a type containing its declarations.
- sliceA slice is a view representing a portion of a contiguous sequence of elements, typically through a pointer and a length.
- interfaceAn interface is an abstraction that exposes defined operations or services while hiding underlying implementation details.
- functionA subroutine is a callable sequence of instructions that returns control to its caller when complete.
- moduleA module is a source-code unit that groups related declarations and functionality within a program.
- single-item pointerA single-item pointer is a pointer type whose referent is one item rather than an indexed sequence of items.
- OpenGL contextAn OpenGL context is the state container associated with an OpenGL connection to a display system and its rendering resources.
- separation of concernsSeparation of concerns is a design principle that partitions a system so each component addresses a limited set of related responsibilities.
- rasterization pipelineA rasterization pipeline is a graphics-processing sequence that converts geometric primitives into shaded fragments and writes them to a framebuffer.
- hardware registerA register is a small, directly addressable storage location within a processor or virtual machine for holding a value during computation.
- @compileError@compileError is a Zig compile-time builtin that emits a compilation error with a specified message.
- lazy evaluationLazy evaluation is an evaluation strategy that delays computing an expression until its value is needed.
- modularityModularity is the organization of software into separable components with focused responsibilities and reusable interfaces.
- RaylibRaylib is an open-source C library providing simple cross-platform APIs for windowing, graphics, input, and audio in games and multimedia applications.
- comptime parserComptime parsing is the compile-time transformation of raw input data into program values or data structures.
- comptime type parameterA comptime type parameter is a Zig function parameter whose type value is supplied and evaluated at compile time.
- generic functionA generic function is a function defined with type or value parameters so it can operate across multiple concrete instantiations.
- labeled blockA labeled block is a named Zig block that can be exited with break and can yield a value.
- labelA label is a name attached to a block or loop that permits targeted break control flow.
- std.mem.tokenizeScalarstd.mem.tokenizeScalar is a Zig standard-library generic function that returns an iterator splitting text on a scalar delimiter.
- build stageA build step is a unit of a build process that produces an output from source code or a preceding build step.
- vertex shaderA vertex shader is a programmable graphics pipeline stage that processes individual vertices and outputs their transformed positions.
- TCPTCP is the Transmission Control Protocol, a transport-layer protocol that provides reliable ordered byte-stream communication between hosts.
- type coercionType coercion is the conversion of a value from one type to another so that an operation can accept it.
- shaderA shader is a specialized program that performs a stage of graphics processing, such as transforming vertices or shading fragments.
- bufferA buffer is a temporary memory area that holds data before it is processed or transferred.
- gladglad is a generator for libraries that load graphics API functions for specified API versions and extensions.
- readFileAllocreadFileAlloc is a std.fs.Dir function that reads a file's contents into dynamically allocated memory.
- std.Io.Writerstd.Io.Writer is a Zig standard-library interface for writing data to output destinations.
- draw callA draw call is a graphics API command that instructs the graphics system to render geometry using configured state.
- namespaceA namespace is a named scope that groups program declarations and prevents naming conflicts.
- GUI windowA graphical window is a bounded on-screen region managed by a windowing system for displaying and interacting with application content.
- structA struct is a composite type that groups named fields and can also contain associated declarations or functions.
- pointerA pointer type represents values that refer to memory locations or other objects.
- error codeAn error code is a value returned or stored to indicate that an operation failed and often identify the failure kind.
- chip-8 memoryCHIP-8 memory is the interpreter's data structure representing the virtual machine's addressable program and data storage.
- main functionA main function is the designated entry point that begins execution of a program.
- application binary interfaceAn application binary interface specifies how compiled components interact at the binary level, including calling conventions and data representation.
- vertex attributeA vertex attribute is a piece of per-vertex data, such as position, color, or texture coordinates, supplied to a graphics pipeline.
- explicit memory managementManual memory management is the explicit allocation, ownership, and release of dynamically used memory by program code.
- HTTPHTTP is an application-layer network protocol that defines request and response semantics for transferring hypertext and related resources.
- standard libraryA standard library is the collection of general-purpose modules and APIs distributed as part of a programming language implementation.
- bytecodeBytecode is a compact instruction representation intended to be executed by an interpreter or virtual machine.
- echo serverThe echo server is the book's example server program that returns processed request text to clients.
- vertex array objectA vertex array object is an OpenGL object that stores vertex attribute configuration and associated buffer bindings.
- Zig build systemThe Zig build system is the build tool integrated with Zig for compiling Zig, C, and C++ projects and controlling build configuration.
- CHIP-8 displayThe CHIP-8 display is a two-dimensional output surface whose pixels represent the virtual machine's visual screen state.
- nullNull is a value representing the absence of an object or valid pointed-to item.
- Zig compilerThe Zig compiler translates Zig programs and performs compile-time validation and optimization.
- bufferingBuffering is the temporary storage of input or output data before it is processed or transferred.
- I/OInput/output is the transfer of data between a program and external devices, files, networks, or other processes.
- null terminationA NUL terminator is a zero byte placed after text data to mark the end of a byte string.
- CHIP-8 virtual machineThe CHIP-8 virtual machine is the book's emulated CHIP-8 execution component.
- dangling pointerA dangling pointer is a pointer that retains an address after the data formerly stored there is no longer valid.
- ownershipMemory ownership is the responsibility for managing the lifetime and eventual release of allocated memory.
- tryIn Zig, try is an error-propagation operator that returns an error from the enclosing function when its error-union operand contains an error.
- error unionAn error union is a Zig type whose values contain either an error or a payload value of an inner type.
- CHIP-8 keypadThe CHIP-8 keypad is the virtual machine's 16-key input interface.
- GPUA graphics processing unit is a processor specialized for highly parallel graphics and compute operations.
- hermetic build systemBuild hermeticity is the property that a build's results depend only on declared, self-contained inputs rather than external environment state.
- dynamic linkingDynamic linking is a linking technique in which an executable records its dependency on a separately provided library that is loaded at runtime.
- void typeVoid is a type representing the absence of a return value.
- OpenGL objectAn OpenGL object is an OpenGL-managed construct that contains state and is referenced by a name.
- command-line argumentA command line argument is a value supplied to a program when it is invoked from a command-line interface.
- integer overflowInteger overflow occurs when an arithmetic result cannot be represented in the destination integer type's range.
- WrappingAddWrapping addition is integer addition that returns the modulo-width result when the mathematical sum overflows.
- genericsA generic is a parameterized program construct that can be instantiated for different types or values.
- coordinate systemA coordinate system is a framework that assigns numerical coordinates to positions in a geometric space.
- catchIn Zig, catch is an error-handling expression that evaluates an error-union operand and executes a fallback expression when the operand contains an error.
- build systemA build system is software that automates source compilation, linking, dependency handling, and related artifact-generation steps.
- multi-item pointerA many-item pointer is a Zig pointer type that represents the address of an unspecified number of contiguous elements without storing their length.
- @compileLog@compileLog is a Zig builtin that emits compile-time diagnostic output and prevents successful final compilation.
- @embedFile@embedFile is a Zig compile-time builtin that embeds a file's contents into a program as a byte slice.
- int32i32 is Zig's signed 32-bit integer type.
- foreign function interfaceA foreign function interface is an interface that allows code written in one programming language to call or interoperate with code written in another.
- break statementbreak is a control-flow construct that exits a loop or labeled block, optionally producing a value.
- comptime memorizationComptime memoization is the Zig compiler's caching of a compile-time function result for repeated calls with the same input.
- duck typingDuck typing is accepting a value based on whether its available operations satisfy the code's requirements rather than on an explicitly declared interface.
- constantA const variable is a binding whose value cannot be reassigned after declaration.
- error valueAn error value is a value representing a failure condition that a Zig operation or function can return.
- lifetimeA lifetime is the period during which a program's data remains valid and available in storage.
- type hintsA type annotation is source-code syntax that explicitly specifies the type of a value, variable, parameter, or other program element.
- rasterizationRasterization is the process of converting geometric representations into pixels on a grid.
- deferIn Zig, defer schedules an expression or block to execute when the enclosing scope exits.
- composabilityComposability is the property of software parts being combineable into larger systems through well-defined interactions.
- switch statementA switch statement is a control-flow construct that selects code to execute based on an expression's matching case.
- type inferenceType inference is compiler deduction of a program expression's data type from its context and values.
- pixelA pixel is an individual addressable picture element in a raster image or display.
- heapHeap memory is dynamically managed storage requested during program execution for data whose size or lifetime is not fixed by a function call.
- integer wraparoundWrapping arithmetic is integer arithmetic whose result wraps modulo the destination type's representable range on overflow.
- hexadecimal keypadA hexadecimal keypad is an input device whose keys represent hexadecimal digits.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
