<<Download>> Download Microsoft Word Course Outline Icon Word Version Download PDF Course Outline Icon PDF Version

Updated June 2026

Zig Essentials

Class Duration

21 hours of live training delivered over 3 days.

Student Prerequisites

  • Prior programming experience in some language (C, C++, Rust, Go, or similar is ideal)
  • Comfort with the command line and a compiler-based workflow
  • No prior Zig experience required

Target Audience

  • All students must have programming experience

Developers ready to go deeper can continue with Advanced Zig.

Description

The Zig Essentials class teaches students how to write software using the Zig programming language. Zig is a general-purpose programming language and toolchain for creating robust, optimal, and reusable software: a compiled, lower-level, hardware-friendly, system-level language. Zig improves on C through customized memory control, null reference protection, and required error handling. Unlike Rust, Zig allows low-level memory control with syntax and memory model features to help avoid memory leaks, and it provides interoperability with existing C libraries. This class focuses on learning the data types, control flow structures, code organization, memory management, and other Zig language features.

Learning Outcomes

  • Learn how to build and run Zig programs.
  • Explore features unique to Zig that set it apart from other languages.
  • Understand where Zig is a good choice for writing software.
  • Practice using the Zig toolchain.
  • Explore how Zig can be used as a drop-in replacement for C.
  • Experience how Zig enables Performance and Safety.
  • Apply modern techniques of memory control, null reference handling, and error handling with a lower-level language.

Training Materials

All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises.

Software Requirements

Students will need a free, personal GitHub account to access the courseware. Student will need permission to install Zig, GCC, and Visual Studio Code on their computers. Also, students will need permission to install Visual Studio Code extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.

Training Topics

Why Zig?

  • What is Zig?
  • What problems does Zig solve?
  • Zig compared to C
  • Zig compared to other Languages
  • Zig Zen

Getting Started

  • Zig Toolchain
  • Hello, Zig!
  • Code and Debug with VSCode
  • Zig Standard Library
  • Zig Source Files
  • Cross Compilation

Language Features in Hello Zig

  • Importing from the Standard Library
  • Constants
  • Define a Public "main" Function
  • Try Statement
  • Error Union Types
  • String Interpolation
  • Comments

Zig Project Scaffolding

  • Create a New Executable Project
  • Create a New Library Project
  • Build and Run
  • Build and Test

Console Apps

  • Print Output to the Terminal
  • Format Specifiers
  • Anonymous Struct Literals
  • Capture Input from the Terminal
  • String Comparison
  • While Loop
  • Error Handling

Data Types

  • Integers
  • Floats
  • Arrays
  • Pointers
  • Slices

Data Structures

  • Struct
  • Enum
  • Union

Variables

  • Variable Name Rules
  • Container Level Variables
  • Compile-Time vs. Run-Time Variables
  • Local Variables

Control Flow

  • Expressions and Operators
  • While/For Loops
  • Break/Continue Statements
  • If Statement
  • Switch Statement
  • Try/Catch Statement
  • Defer/ErrDefer Statement

Functions

  • What is a Function?
  • Define a Function
  • Call a Function
  • Pass Parameters to a Function
  • Immutable vs Mutable Parameters
  • Importing Functions from Other Zig Code Files

Strings

  • UTF-8 Data Type
  • Character Arrays
  • Buffers
  • Print Formatted Strings
  • Capture Strings Console Input
  • String Copy
  • String Comparison

Memory Control

  • Memory Allocation Philosophy
  • Memory Control vs. Memory Safety
  • Choosing an Allocators
  • Heap Allocation Failure
  • Lifetime and Ownership
  • Optional and Optional Pointers
  • Null References

Program a Zig "Object"

  • Compared to C/C++/Python/JavaScript
  • Anonymous Structs
  • Anonymous Struct Literals
  • Data Fields
  • Constant Fields
  • Error Enums
  • Function Members
  • Function Patterns
  • Dynamic Memory Allocation

Async I/O (Zig 0.15+)

  • The std.Io interface
  • Io.async, Io.await, and the new async/await model
  • Cooperative concurrency with explicit scheduling
  • Comparison with previous Zig 0.10-era async (which was removed and reintroduced)

Build System 2.0

  • build.zig and build.zig.zon
  • Declaring dependencies (zon files)
  • Creating modules and executables
  • Cross-compilation targets
  • Adding C source files

Testing

  • Zig's built-in testing (test "name" { ... })
  • What can be tested?
  • Assert output with try expect
  • std.testing.expectEqual, expectError, expectEqualStrings
<<Download>> Download Microsoft Word Course Outline Icon Word Version Download PDF Course Outline Icon PDF Version