Top 1,000 Features Creators Resources Blog Explorer Download
GitHub icon

Zig

< >

Zig is an open source programming language created in 2015 by Andrew Kelley.

Source code:
git clone https://github.com/ziglang/zig
#54on PLDB 9Years Old 4kRepos

Try now: Riju · TIO

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.


Example from Compiler Explorer:
// Type your code here, or load an example. export fn square(num: i32) i32 { return num * num; }
Example from Riju:
const std = @import("std"); pub fn main() anyerror!void { std.log.info("Hello, world!", .{}); }
Example from hello-world:
const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello World", .{}); }

Language features

Feature Supported Token Example
Comments ✓
Line Comments ✓
Binary Literals ✓
Integers ✓
Floats ✓
Hexadecimals ✓
Octals ✓
Strings ✓ "
"Hello world"
Print() Debugging ✓ std.debug.print

View source

- Build the next great programming language · About · Acknowledgements · Extensions · Day 625 · feedback@pldb.io