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 a PolydatKernel.

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, and no cursor limit.

Enums§

EmbeddingError
Typed error ontology for the embedded-evaluation surface.

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_astDeprecated
compile_ast_with_options under the default options.
compile_ast_strictDeprecated
compile_ast_with_options with a source directory and strictness alone.
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_ast_with_libsDeprecated
compile_ast_with_options with the source directory, library directories, outputs to keep, strictness, and context label as separate parameters.
compile_ast_with_options
compile_polydat_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_pathDeprecated
compile_ast_with_options with a source directory alone.
compile_polydat
Compile a .polydat source string into the interpreter’s kernel, under the default options: compile_polydat_with_options with CompileOptions::default. The interpreter is the semantic oracle; compile_polydat_kernel is the same program on the default engine.
compile_polydat_checked
Compile with full diagnostics: errors, warnings, suggestions, on the default 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 compile event log: compile_polydat_with_engine on Engine::default.
compile_polydat_kernel_with_tiles
compile_polydat_with_tiles on Engine::default: the same program with the same tiles appended, as a compiled kernel.
compile_polydat_strictDeprecated
compile_polydat_with_options with a source directory and strictness alone.
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_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 other compile_polydat* entry points build the interpreter kernel and remain for that.
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.
compile_polydat_with_libsDeprecated
compile_polydat_with_options with the source directory, library directories, outputs to keep, strictness, and context label as separate parameters.
compile_polydat_with_libs_and_limitDeprecated
compile_polydat_with_options with every option as a separate parameter.
compile_polydat_with_log
compile_polydat_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_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_with_outputsDeprecated
compile_polydat_with_options with a source directory, the outputs to keep, and strictness as separate parameters.
compile_polydat_with_pathDeprecated
compile_polydat_with_options with a source directory alone.
compile_polydat_with_tiles
Compile source together with tiles a host built from what it holds (SRD 114 §5.6): template text, JSON text, or a parsed JSON value, via crate::tile. The tiles are appended as tile statements, so they see every wire the source defines and are wires themselves.
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.
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 kernel, 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
Classify a catalog adapter as lossless or lossy per expression_engine.md §5.4.3. Lossless conversions preserve value identity (widening numeric types, to-string display roundtrips); lossy conversions change information content (truncation, boolean projection).
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.