← See all notes

Table of Contents

Zig

Learning Resources 🔗

Blog posts / Tips 🔗

Packages 🔗

Snippets 🔗

Debugging with Xcode 🔗

  1. Open Xcode
  2. Debug > Attach to Process OR Debug > Debug Executable…
    1. Options > Console > Xcode (with Standard Input) — if needed
    2. Set breakpoints with ⌥ + ⌘ + \

Debugging with lldb 🔗

Scripting 🔗

https://cryptocode.github.io/blog/docs/shebang/

//usr/bin/env zig run "$0" -- "$@" ; exit 
const std = @import("std");
pub fn main() !void {
    std.log.info("Awesome, it works!", .{});
}
$ chmod +x myscript.zig
$ ./script.zig
info: Awesome, it works!

Watcher 🔗

$ zig build check -fincremental --prominent-compile-errors --watch
$ zig build -fincremental --prominent-compile-errors --watch

# Maybe use watchexec?
$ watchexec -e zig "zig fmt . && zig check . && zig test ."