- source bundle: a /docs directory with QUICK.md (Quick Reference plus a where-to-read table), language/*.md, diagnostics/errors.md and the AIR bundle only under air/; built from docs/agent/source-bundle.txt (> output files, @manifest includes) by zig build agent-reference - Quick Reference examples are checked: every aji block must be an excerpt of a conformance program in tests/conformance/source/quickref (zig build test fails otherwise); QR fixes found by the check (mut d = data, region not auto-borrowed, statement/borrow blocks that could not verify, io_error match) - frontend: task.*/channel.*/mutex.* are not-yet-implemented, not E7006 - aji lower --stats: mechanical_air_eliminated_raw and _normalized (each byte-string materialization counted as one constant; spec 15 §11) - harness: profile aji_source (doc_groups), per-file and per-group docs metrics on distinctive lines, profile columns (tool calls, lowered AIR raw/normalized, docs files read, IR-form and type-mismatch counts), dev-echo aji_source variant, scripted run and test, source token report - plan: P6A-8 done, P6A-9 criteria; Q-021/Q-022 resolved; unsafe block deferred
22 lines
494 B
Rust
22 lines
494 B
Rust
// Quick Reference §1: the skeleton program.
|
|
// expect: run
|
|
// grant: input=io.read
|
|
// grant: out=io.write
|
|
// stdin: hi
|
|
// result: null
|
|
// stdout: hi
|
|
// phase: 6
|
|
// spec: docs/agent/quick-reference.md
|
|
module demo.echo
|
|
|
|
fn main(input: cap<io.read>, out: cap<io.write>) -> void
|
|
effects [io.read, io.write]
|
|
{
|
|
var buf: [u8; 64] = zero;
|
|
loop {
|
|
let n = io.stdin_read(input, mut buf) or trap;
|
|
if n == 0 { return; }
|
|
io.stdout_write(out, ref buf[0..n]) or trap;
|
|
}
|
|
}
|