Skip to main content

Module emit

Module emit 

Source
Expand description

Row emission as a graph node.

The polydat binary’s --emit option is a source transform: it appends one binding, __emit := emit_row(format, names, a, b, ...), to the program. The node sees every wire it names through ordinary wiring, so emission is part of the kernel rather than a decorator around it. When the for construct lands, the same binding is inserted inside the traversed block and observes that block’s scope.

Rows accumulate in a thread-local buffer so concurrent fibers never contend. The harness drains each fiber’s buffer with take_rows at chunk boundaries and decides on ordering.

Structs§

EmitRow
Append one formatted row to the calling thread’s buffer and return the number of values emitted. format is map, csv, or jsonl; names is the comma-separated list of wire names in the same order as the variadic values.

Enums§

EmitFormat
Formats supported by emit_row. Parsed from the node’s format constant.

Functions§

header
The header line for a format, if the format has one.
render_row
Render one row without touching the buffer.
take_rows
Drain the calling thread’s emitted rows.