Skip to main content

Module compile

Module compile 

Source
Expand description

DSL-to-assembly bridge: compile a parsed Polydat AST into a runtime kernel.

Walks the AST, resolves function names to node constructors, wires the PolydatAssembler, and produces the interpreter’s PolydatKernel or any engine’s boxed Kernel.

Structs§

CompileOptions
The options every entry point compiles under. A host that names none gets the defaults: no source directory, no library paths, every binding an output, lax typing, the default context label, no cursor limit, and the most compiled engine this build has.

Enums§

EmbeddingError
Typed error ontology for the embedded-evaluation surface.
InputVariance
What the compiler does with an open input, one whose type it inferred rather than the author declared: an auto-extern, or an extern a scope builder synthesized (input_variance.md §3, §4). Coordinates and declared inputs are never affected.

Traits§

HostType
Host-facing type that polydat can return from the typed embedding surfaces. The trait declares the polydat PortType the Rust type corresponds to and the conversion from the returned crate::ast::Value back to the host type.

Functions§

compile_ast_interpreter_with_options
compile_polydat_interpreter_with_options for an already parsed, possibly transformed, program. source is the text the program was parsed from and is used for diagnostics only.
compile_ast_with_engine
compile_polydat_with_engine from a parsed file: the parent compiles on engine through the assembler, and each for body compiles once for the interpreter as the traversal’s record and on any engine at activation (engine parity, step 8).
compile_polydat
Compile a .polydat source string under the default options, on the engine those options name — which is Engine::default, the most native form the build has.
compile_polydat_checked
Compile with full diagnostics: errors, warnings, suggestions, on the default engine.
compile_polydat_interpreter
compile_polydat returning the interpreter’s concrete kernel.
compile_polydat_interpreter_with_log
compile_polydat_interpreter_with_options under the default options, with the compile event log: the same kernel compile_polydat builds, with every pragma, assembly, fold, and tile event recorded.
compile_polydat_interpreter_with_options
Compile Polydat source into the interpreter’s kernel under options, recording pragma and assembly events in log when one is given: the interpreter-typed entry point every other interpreter form reduces to. compile_polydat_with_engine is the same compile on any engine.
compile_polydat_kernel
compile_polydat_with on Engine::default: compiled code, with the JIT where the build has it.
compile_polydat_kernel_with_options
compile_polydat_kernel with the kernel path’s options (source directory, library paths, required outputs, strict typing, the error context label, the cursor limit, and the engine preference) and the compile event log.
compile_polydat_tier1_simd_ordinal
Compile one selected scalar output into the conservative perfect-ordinal Tier-1 SIMD executor.
compile_polydat_to_assembler
Compile Polydat source to an assembler (not yet compiled to a kernel).
compile_polydat_to_assembler_with
compile_polydat_to_assembler with the options the kernel entry points take: a source directory for relative imports, library directories, required outputs, strict typing, a diagnostic context, and a cursor limit. The assembler it returns is the graph compile_polydat_interpreter_with_options would compile from the same source and options, ready for any engine.
compile_polydat_with
Compile source for engine: the interpreter, the closure tier, the hybrid kernel, or pure native code. Every engine accepts every program the interpreter accepts, or refuses it with a reason (crate::KernelError::Refused); a host drives the result through crate::Kernel without knowing which engine it holds. The compile_polydat_kernel* and compile_polydat_checked entry points and compile_polydat are this on Engine::default(); compile_polydat_interpreter_with_options and the deprecated forms build the interpreter’s kernel.
compile_polydat_with_engine
compile_polydat_with with the kernel path’s options (source directory, library paths, required outputs, strict typing, the error context label, the cursor limit) and the compile event log. On the interpreter this is the whole kernel path, traversals included; on a compiled engine the assembler entry point followed by PolydatAssembler::compile_engine_with_log.
eval_const_expr
Evaluate a constant expression by compiling it as a one-binding program: what a comprehension source such as partitions("*\/4", 1000) goes through. Cached by source text, so the same text compiles once per process (SRD 113 §5.2). An expression that reaches a dynamic input is a lifecycle error. The compile, when there is one, is recorded in a ledger of its own; eval_const_expr_for charges it to a tree’s.
eval_const_expr_for
eval_const_expr with its compile, when the text is not cached, recorded in ledger: what a traversal source or predicate that has to compile charges to the tree that opened it.
eval_const_expr_typed
Const-fold the expression and convert the typed Value into the host’s requested Rust type. Compile-time type alignment per expression_engine.md §5.3 + E5 + E7.
eval_const_expr_typed_strict
Strict-mode variant of eval_const_expr_typed.
eval_kernel_bound_typed
Two-step: interpolate placeholders against scope, then const-fold + type-convert. The canonical pattern for kernel-bound typed embedding per expression_engine.md §3.2 + §5.3.
eval_kernel_bound_typed_strict
Strict-mode kernel-bound variant. Composes crate::kernel::interp::interpolate_via_kernel with eval_const_expr_typed_strict.
is_lossless_adapter
Whether a conversion from one port type to another keeps the value: whether every number from can carry is a number to can carry.
parse_polydat
Parse Polydat source into the program tree, the form every transform reads and rewrites.
parse_polydat_with_tile_defaults
parse_polydat with the hole delimiters and directive sigil a tile body that declares none of its own is read with.
positional_str_lit
Extract a string literal from an optional positional argument. Re-exported for cursor-sugar handlers in node modules that validate string-literal-only constructor args.
stdlib_sources
Return the embedded standard library module sources.