Skip to main content

Module factory

Module factory 

Source
Expand description

External-facing factory module. Made pub (was pub(crate)) so crates that host polydat nodes outside the polydat crate (host runtimes) can reach ConstArg, compile_ctx, and build_node from their register_nodes! invocations. Node factory: maps Polydat function names to runtime node instances.

build_node is the single dispatch point used by the compiler’s compile_binding to turn a parsed call expression into a Box<dyn PolydatNode>. ConstArg captures assembly-time constant arguments extracted from the AST.

Dispatch is decentralized: each node module exposes its own build_node function returning Option<Result<...>>. The top-level build_node here tries each module in turn and falls back to the registry for variadic nodes.

Modules§

compile_ctx
Build a node from a function name and its arguments.

Enums§

ConstArg
Constant arguments extracted from the AST.

Functions§

build_node
Build the node func takes for the given wires, their types, and constant arguments, through the registry; an unknown function or a mismatched signature is an error naming it.