Skip to content

Welcome to Zig

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Robust

  • Behavior is correct even for edge cases such as out of memory.

Optimal

  • Write programs the best way they can behave and perform.

Reusable

  • The same code works in many environments that have different constraints.

Maintainable

  • Precisely communicate intent to the compiler and other programmers. The language imposes a low overhead to reading code and is resilient to changing requirements and environments.

Often the most efficient way to learn something new is to see examples, so this documentation shows how to use each of Zig's features. It is all on one page so you can search with your browser's search tool.

The code samples in this document are compiled and tested as part of the main test suite of Zig.