Skip to main content

Module surfaces

Module surfaces 

Source
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 via K’s KernelScope impl.
  • 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_stream or scoped_kernel_stream returns 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
KernelScope trait + ScopedKernelInstance — the second-order surface’s value type (spec §9.5).
polydat_kernel
Bridge between the algebra-layer KernelScope surface and polydat’s PolydatKernel scope-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 CompiledComprehension ready to dispense. Equivalent to CompiledComprehension::from_ast(ast).