A number
the-language

Go to ziglang.org and download the latest stable release of Zig. It's a single zip/tar file -- no installer, no setup wizard. Extract it somewhere and remember where you put it.

Now open a terminal. On Windows, press Win+R, type cmd, hit Enter. On macOS, open Terminal from Applications. On Linux, you know what to do.

In the terminal, navigate to the folder where you extracted Zig and check that it works:

zig version

If you get a version number, you're good. If you get "command not found", Zig isn't in your PATH yet -- look up how to add a folder to PATH on your operating system.

Now create a folder for your project. This is where you'll work for the rest of the book. Navigate into it:

mkdir minizig
cd minizig

Create a file called minizig.zig. Use any text editor -- Notepad, nano, anything. Find the "Hello World" example in the Zig documentation and paste it in. One thing: change !void to just void -- we don't use Zig's error handling in this book.

Compile it:

zig build-exe minizig.zig

This produces an executable called minizig (or minizig.exe on Windows). Run it:

./minizig

On Windows, type minizig.exe instead. You should see output.

That's it. You have a working Zig setup.

const std = @import("std");
const print = std.debug.print;

pub fn main() void {
    print("hello\n", .{});
}