Skip to main content

module

Function module 

Source
pub fn module<'a, G>(
    get_node: GetNode<'a>,
    g: G,
    entrypoints: &[Entrypoint],
    config: &Config,
) -> Result<Vec<ExprKind>, ModuleError>
Expand description

Given a root gantz graph, generate the full module with all the necessary functions for executing it: a function per node variant (input/output configuration), a graph fn per nested level variant, and a function per entrypoint’s evaluation.

Lowers through the join-point IR pipeline (lower -> ir -> emit), with the toggles in Config applied along the way. Nested graphs compile call-based: each level becomes one graph-fn-{path}-i{mask} per active-inlet variant, which parents call like a node fn. An entrypoint sourced inside a nested graph becomes a per-level fn whose result - (list value state'), with value a (list branch-ix vals) pair when the push reaches the outlets through branching - the parent level continues from (push-through-outlet as an ordinary value return).