Skip to main content

Module compiler

Module compiler 

Source
Expand description

Main WASM module assembler.

Orchestrates the code generation pipeline:

  1. Analyse the AST and collect metadata (state fields, actions, views, etc.)
  2. Build the data segment (intern string constants)
  3. Emit runtime helper functions
  4. Emit space-level functions (init, dispatch, render, get_state, …)
  5. Assemble all WASM sections into a valid module
  6. Validate with wasmparser

Structs§

DataSegmentTrackerClone
A clonable wrapper around key fields from DataSegmentTracker.
FuncContext
State maintained while generating code for a single function body.
LambdaBody
A lambda body collected during expression codegen for deferred compilation.

Functions§

compile
Compile a validated PEPL Program into a .wasm binary.
compile_with_source_map
Compile a validated PEPL Program and return both the WASM binary and a SourceMap mapping WASM function indices to PEPL source spans.