tabnas-alchemy (Rust)
The tabnas-alchemy crate, library tabnas_alchemy and binary alchemy:
the alchemy language as a tabnas grammar plugin, with its checker, its
planner and its interpreter over tabnas-transduce and tabnas-render.
The reader (parse, canonical, format, desugar), the resolver, the
checker (check, types), the evaluator (interp, value) and its
lowering to sinks (lower), the effect summary (effects), the embedded
standard library (stdlib), and the API a host embeds (compile,
Program). See the repository README,
AGENTS.md and docs/language.md.
use ;
use ;
let program = compile?;
assert_eq!;
let mut sink = program.sink?;
sink.event?;
sink.event?;
sink.event?;
# Ok::
The host pushes the source's events into the sink and one End; the
output is written through a coalescing writer and flushed at End.
Program::output says what the program produces (its own text, table
rows the host renders as CSV or JSON, or JSON events), row_selector
under which selector the source may be read one row at a time, and
explain prints the plan report. compile builds the plan as well as
checking the program, under MAX_PLAN_STEPS and MAX_EVAL_DEPTH, on a
thread of STACK_BYTES; a host running programs it did not write gives
the sink a thread of that size, passes its abort flag to
Program::with_abort, and sets max_output_bytes (see Embedding in
docs/language.md).
The engine, the two crates the language lowers to, the fixture runner and
the test grammars are sibling checkouts named by path in Cargo.toml. From
this directory: cargo test --all-targets, cargo test --doc,
cargo clippy --all-targets --all-features -- -D warnings.