ZIG 101

ECOSYSTEM research · ZIG

1. ZIG Basics: Hello, World!

Let's start with the classic. In Zig, every program starts from a main function. Notice the ! and the void —we'll get to that.

zig

const std = @import("std");

pub fn main() !void {

const stdout = std.io.getStdOut().writer();

try stdout.print("Hello, {s}!\n", .{"World"});

}

Back to ECOSYSTEM research