Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
GET STARTED Latest Release:   0.7.1
Documentation Changes

⚡ A Simple Language

Focus on debugging your application rather than debugging your programming language knowledge.

  • No hidden control flow.
  • No hidden memory allocations.
  • No preprocessor, no macros.

⚡ Comptime

A fresh approach to metaprogramming based on compile-time code execution and lazy evaluation.

  • Call any function at compile-time.
  • Manipulate types as values without runtime overhead.
  • Comptime emulates the target architecture.

⚡ Performance Meets Safety

Write fast, clear code capable of handling all error conditions.

  • The language gracefully guides your error handling logic.
  • Configurable runtime checks help you strike a balance between performance and safety guarantees.
  • Take advantage of vector types to express SIMD instructions portably.

In-depth overview

More code samples

const std = @import("std");
const json = std.json;
const payload =
    \\{
    \\    "vals": {
    \\        "testing": 1,
    \\        "production": 42
    \\    },
    \\    "uptime": 9999
    \\}
;
const Config = struct {
    vals: struct { testing: u8, production: u8 },
    uptime: u64,
};
const config = x: {
    var stream = json.TokenStream.init(payload);
    const res = json.parse(Config, &stream, .{});
    // Assert no error can occur since we are
    // parsing this JSON at comptime!
    break :x res catch unreachable;
};
pub fn main() !void {
    if (config.vals.production > 50) {
        @compileError("only up to 50 supported");
    }
    std.log.info("up={d}", .{config.uptime});
}

Community

The Zig community is decentralized

Anyone is free to start and maintain their own space for the community to gather.
There is no concept of “official” or “unofficial”, however, each gathering place has its own moderators and rules.

Main development

The Zig repository can be found at https://github.com/ziglang/zig, where we also host the issue tracker and discuss proposals.
Contributors are expected to follow Zig’s Code of Conduct.

Zig Software Foundation

The ZSF is a 501(c)(3) non-profit corporation.

The Zig Software Foundation is a non-profit corporation founded in 2020 by Andrew Kelley, the creator of Zig, with the goal of supporting the development of the language. Currently, the ZSF is able to offer paid work at competitive rates to a small number of core contributors. We hope to be able to extend this offer to more core contributors in the future.

The Zig Software Foundation is sustained by donations.

Learn More

Sponsors

Corporate Sponsors

The following companies are providing direct financial support to the Zig Software foundation.

GitHub Sponsors

Thanks to people who sponsor Zig, the project is accountable to the open source community rather than corporate shareholders. In particular, these fine folks sponsor Zig for $200/month or more:

This section is updated at the beginning of each month.

All your codebase are belong to us.