○
Planned This feature is planned but not yet implemented.
Parked on binding-field access in ARGUMENT position, and no longer on `~`.
Failure Output
[REGISTRY] Creating dispatcher for scope 'bench'
[REGISTRY] Found 2 events
[REGISTRY] Generated 16700 bytes
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission) Code
// REAL Interpreter Benchmark
// Tests the FULL pipeline: parse Koru flow string → execute → return result
// Uses a realistic multi-step flow with continuations
~import std/runtime
~import std/interpreter
const std = @import("std");
// ============================================================================
// Events that the flow will dispatch to
// ============================================================================
~pub tor compute { a: string, b: string, op: string }
| result string
| error string
~proc compute|zig {
const a_val = std.fmt.parseInt(i64, a, 10) catch 0;
const b_val = std.fmt.parseInt(i64, b, 10) catch 0;
const value = if (std.mem.eql(u8, op, "add"))
a_val + b_val
else if (std.mem.eql(u8, op, "mul"))
a_val * b_val
else if (std.mem.eql(u8, op, "sub"))
a_val - b_val
else
0;
var buf: [32]u8 = undefined;
const result_str = std.fmt.bufPrint(&buf, "{d}", .{value}) catch "0";
return .{ .result = result_str };
}
~pub tor print-result { value: string }
~proc print-result|zig {
std.debug.print("Result: {s}\n", .{value});
}
// Register events for runtime dispatch
~std/runtime:register(scope: "bench") {
compute
print-result
}
// ============================================================================
// The flow we'll parse and execute at runtime
// This is a REAL flow with continuations
// ============================================================================
const FLOW_SOURCE =
\\compute(a: "42", b: "17", op: "add")
\\| result r |> print-result(r.value)
\\| error e |> print-result(value: e.message)
;
~import std/io
// ============================================================================
// Benchmark: Parse and execute the flow
// ============================================================================
~std/interpreter:run(source: FLOW_SOURCE, dispatcher: dispatch_bench)
| result r |> std/io:print.ln("Success: branch {{ r.value.branch:s }}")
| exhausted e |> std/io:print.ln("Exhausted: {{ e.last_event:s }}")
| parse-error e |> std/io:print.ln("Error: {{ e.message:s }}")
| validation-error e |> std/io:print.ln("Error: {{ e:s }}")
| dispatch-error e |> std/io:print.ln("Error: {{ e.message:s }}")
Actual
Result: <r.value>
Success: branch
Expected output
Result: 59
Success: branch
Flows
flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "bench", source: compute
print-result)
flow ~run click a branch to expand · @labels scroll to their anchor
run (source: FLOW_SOURCE, dispatcher: dispatch_bench)
Test Configuration
MUST_RUN