Issue #2853: A byte stream in std (io::Stream), and a @stream entry that reads over it with items that view its buffers

Open and answer this issue on GitHub.

ready, queued · opened 2026-11-28 · updated 2026-11-29 · 0 comments

Part of #2834 After #2851 After #2852

ADR-grammar-typed-read-v2 D7 (owner, 2026-11-28, #2834): a @stream entry takes a byte stream as it takes a String; its items view the stream’s buffers (ADR-stream-buffers-v1 D1, D7); the walk over a stream runs the parse in a thread of its own where the body pauses, otherwise as each. Today an entry takes String or Bytes (NK1282), and there is no std type for a byte stream.

To build

  1. A byte stream in std. Propose io::Stream (from standard input, a file opened as a stream, a connection’s read side) in std.contracts with its platform reads (ADR-platform-layer-v1); the names are the supervisor’s to confirm before the commit (ADR-stream-buffers-v1 section 6): the builder reports Result: partial with the proposal if not confirmed in the brief. Test: tests/compiler/tests/a_byte_stream_reads_standard_input.nika, .stdout.
  2. An entry takes it. NK1282 admits an io::Stream argument of a @stream entry; the lowering reads it through winnow-grammar’s reader path into the pool (sized as #2851’s count) and the items view its buffers. Test: a_stream_entry_reads_events_from_standard_input.nika (a small grammar, items printed), .stdout; a program that keeps the items in a list, NK2308 in its .stderr.
  3. The walk table’s stream row. A body that pauses runs the parse in a thread of its own over the stream (ADR-grammar-typed-read-v2 D7’s table), and a blocked read there is not NK2209. Test: a_stream_entry_feeds_a_task_over_a_channel.nika, .stdout.

Done when

The tests of items 1-3 pass; the last commit carries Fixes #N. A Found: line per finding.

Files and limits

std.contracts, crates/nikaia-std/src/io.rs and the grammar runtime (crates/nikaia-std/src/grammar.rs) for the platform part, the grammar lowering (grammar_*.nika), the checker for NK1282, lowered files. Needs winnow-grammar’s reader to hand out views: #2852.

Facts: Grammar, Lowering and lower-std, Checker and views

Back to Open Issues