Hello World
const std = @import("std");
pub fn main() void {
std.debug.print("Hi", .{});
}
Constants
const x: i32 = 10;
Allocators
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
Error Handle
fn do() !void {
return error.Failed;
}
catch |err| { handle(err); }
Structs
const User = struct {
id: u32,
};
Comptime
comptime {
// compile time logic
}