../
Zig
const std = @import("std");
pub fn main() void {
std.debug.print("Hello, {s}!\n", .{"World"});
}
This is a hello, world program in zig.
Initial reactions
- The
importis being assigned to a constant.importtake an arg and finds that file and the items withpubare exported in the LHS- The LHS is just a
struct
- It has
.notation for functions - There is curios
pubkeyword - function is defined using
fn - The type is given after the function
- The second arg for
printhas this ugly.{}notation- This is an anonymous struct notation
printalways takes astructas it second arg.std.debug.print("Hello, {s}!\n", "World");won’t work- It has this
comptimetype that is assigned to constants