@stream walk as a state machine, for zip and interleaved walks (ADR-grammar-typed-read-v1 D7)Open and answer this issue on GitHub.
ready · opened 2026-11-22 · updated 2026-11-22 · 0 comments
Part of #2426 After #2709
ADR-grammar-typed-read-v1 D7, as rewritten after the owner’s decision on #2426 (2026-11-22), lets the compiler choose how a @stream walk runs. Several sequences walked together (zip, interleaved walks) first run one scoped thread per sequence (“The other methods of a @stream walk”, #2709). This issue builds the method that needs no thread: the stream generator as a state machine a consumer drives step by step (pull).
@stream entry in winnow-grammar, a state machine over the entry’s repeated item that yields one item per step without its own stack, behind a codegen switch.zip of two yaml streams against the thread method with callgrind (docs/measuring.md), and keep the method that counts fewer instructions per row of D7’s table.A zip of two @stream calls runs with no thread, as the generated Rust shows. Its test is green, and the counts of item 3 are in the commit message.