Skip to main content

compile_core_modules

Function compile_core_modules 

Source
pub fn compile_core_modules(runtime: &Runtime) -> Result<BytecodeProgram>
Expand description

Compile all core stdlib modules into a single BytecodeProgram

The core modules are those in stdlib/core/ which are auto-imported and available without explicit import statements.

Uses precompiled embedded bytecode when available, falling back to source compilation. Set SHAPE_FORCE_SOURCE_STDLIB=1 to force source.

The compiled program is cached on the passed-in runtime; repeat calls on the same Runtime return a cheap clone of the cached result. Different Runtime instances each build their own cache, which keeps per-Runtime TypeSchemaRegistry ids from colliding across tests that share the same process.

ยงReturns

A merged BytecodeProgram containing all core functions, types, and metas.