⚡ 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.
⚡ Maintain it with Zig
Incrementally improve your C/C++/Zig codebase.
- Use Zig as a zero-dependency, drop-in C/C++ compiler that supports cross-compilation out-of-the-box.
- Leverage
zig build
to create a consistent development environment across all platforms. - Add a Zig compilation unit to C/C++ projects; cross-language LTO is enabled by default.
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
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.