○
Planned This feature is planned but not yet implemented.
Annotation entries as expressions over the compiler context — `build == "release"` evaluated (comptime_eval) against resolved bindings, replacing exact-string flag matching.
Code
// Pins annotation entries as EXPRESSIONS over the compiler context: the
// entry `build == "release"` is a comparison evaluated against the compiler
// context (the --build flag provides the `build` binding), not an opaque
// word string-matched against the flag list. Pipe stays a list delimiter;
// logic lives INSIDE an entry, owned by its author; the consumer (here the
// import gate) decides which entries to honor.
//
// The imported module registers a tap, so the import is load-bearing: the
// [TAP] line in the output IS the expression evaluating true. Run with
// --build=release (COMPILER_FLAGS), so the gate must KEEP the import.
const std = @import("std");
~[build == "release"]import app/test_lib/tracer
~event compute { x: i32 }
| result i32
~proc compute|zig {
std.debug.print("compute({d})\n", .{x});
return .{ .result = x * 2 };
}
~event display { value: i32 }
~proc display|zig {
std.debug.print("Final: {d}\n", .{value});
}
~compute(x: 21)
| result r |> display(value: r)
Expected output
compute(21)
[TAP] compute
Final: 42
Flows
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: 21)
Imported Files
// Tap module — importing it is what wires the tap (the 310_001 mechanism).
// The pin's gated import makes that wiring conditional: this module's output
// appears exactly when the import survives the annotation gate.
const std = @import("std");
~import std/taps
~pub event log { event_name: []const u8 }
~proc log|zig {
std.debug.print("[TAP] {s}\n", .{event_name});
}
~tap(input:compute -> input:display)
| result r |> log(event_name: "compute") => result { result: r }
Test Configuration
MUST_RUN
Compiler Flags:
--build=release