Expand description
Consumption surfaces — spec §9.5.
Three independent first-class consumption surfaces over a shared compiled IR:
CoordinateStream(first-order) — dispenses coordinate tuples (Vec<(String, TupleValue)>).ScopedKernelStream<K>(second-order) — dispenses scoped kernel instances; functor over the first-order viaK’sKernelScopeimpl.scope_once(one-shot) — non-streamed; takes a single coord tuple and produces a single scoped kernel instance.
All three surfaces share the underlying Program via
Arc<Program> but maintain independent dispense state per
spec §9.5.2’s independence contract:
Each call to
coordinate_streamorscoped_kernel_streamreturns a fresh streamer with its own dispense cursor. The streamers share the underlying compiled IR but allocate their own per-streamer state.
The entry point is CompiledComprehension, obtained via
compile(&ast) or CompiledComprehension::from_ast.
Re-exports§
pub use compiled::CompiledComprehension;pub use coord_stream::CoordinateStream;pub use instance::KernelScope;pub use instance::ScopedKernelInstance;pub use polydat_kernel::PolydatKernelScope;pub use polydat_kernel::polydat_value_to_tuple_value;pub use polydat_kernel::tuple_value_to_polydat_value;pub use scope_once::scope_once;pub use scoped_stream::ScopedKernelStream;
Modules§
- compiled
CompiledComprehension— the entry point for the three consumption surfaces.- coord_
stream CoordinateStream— first-order consumption surface (spec §9.5.1).- instance
KernelScopetrait +ScopedKernelInstance— the second-order surface’s value type (spec §9.5).- polydat_
kernel - Bridge between the algebra-layer
KernelScopesurface and polydat’sPolydatKernelscope-binding primitives. - scope_
once scope_once— non-streamed surface (spec §9.5.3).- scoped_
stream ScopedKernelStream<K>— second-order consumption surface (spec §9.5).
Functions§
- compile
- Convenience: compile an AST into a
CompiledComprehensionready to dispense. Equivalent toCompiledComprehension::from_ast(ast).