Skip to main content

Module stdlib

Module stdlib 

Source
Expand description

Standard library compilation for Shape VM

This module handles compiling the core stdlib modules at engine initialization. Core modules are auto-imported and available without explicit imports. Domain-specific modules (finance, iot, etc.) require explicit imports.

Functionsยง

compile_core_modules
Compile all core stdlib modules into a single BytecodeProgram
compile_core_modules_from_source
Compile core stdlib from source (parse + compile). Used as fallback and for tests.
compile_directory
Compile all Shape files in a directory (recursively) into a single BytecodeProgram. Each file is compiled independently, then merged via merge_append.
compile_file
Compile a single Shape file into a BytecodeProgram
compile_source
Compile an in-memory Shape source string into a BytecodeProgram. Used for extension-bundled Shape code (e.g., include_str!("duckdb.shape")).
core_binding_names
Extract top-level binding names from precompiled core bytecode. Used to seed the compiler with known names without loading AST into persistent context.