- Build:
zig build -Doptimize=ReleaseFast - Run:
zig build run -- <args> - Requires Zig 0.15.1 or later
- No lint command configured
- No test framework; no tests present
- Use
const std = @import("std");first - Import specific std modules:
const debug = std.debug; - Local imports:
const term = @import("./term.zig");
- 4-space indentation
- PascalCase for structs/types, snake_case for variables/functions
- Use
constfor immutable values and compile-time constants - Fixed-size arrays preferred:
[64]u8over[]u8
- Explicit types required
- Error unions:
!voidfor functions that can fail - Use
tryfor error propagation,catchfor handling - Custom errors:
error.StackOverflow,error.Underflow
- Structs:
App,Stack,Items - Functions:
init,deinit,mainLoop,push,drop - Constants:
max_stack_len,max_item_len - Variables:
filename_buf,input_buf
- Use
@memsetfor buffer clearing @memcpyfor safe copyingdeferfor cleanup (file handles, terminal state)unreachablefor impossible error paths
- Minimal comments; code should be self-documenting
- Only comment complex logic or TODO items