Expand description
End-to-end source-to-Wasm pipeline.
Callers run these entry points on a thread with at least
crate::compiler_limits::COMPILER_STACK_BYTES of stack.
Structs§
- Compiled
Package - Compiled
Script - Package
Source Module - Parsed
Script - Phase
Timings - Wall-clock spent in each compile phase, filled in as the pipeline runs. A
phase that never runs (e.g.
codegenwhen the front-end errors) stays zero. Surfaced onCompiledScriptfor embedders that report compile-time performance. - Script
Imports
Functions§
- compile_
package - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
package_ checked - compile_
package_ with_ transitive - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
package_ with_ transitive_ checked compile_packagewith the rest of the dependency closure supplied separately.- compile_
package_ with_ transitive_ checked_ for compile_package_with_transitive_checkedfor an embedder that offersstdlib, so the package may import its optional packages.- compile_
parsed_ script_ timed - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
parsed_ script_ timed_ checked - compile_
parsed_ script_ with_ transitive - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
parsed_ script_ with_ transitive_ checked - Compile with declarations needed to reconstruct imported types without exposing those transitive packages to source-level imports.
- compile_
script - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
script_ checked - Compile a script module.
filenameis the DWARF compile-unit name for backtrace source mapping;fileis this source’sFileIdin the caller’sSourcesregistry.packagesare real package declarations that emit Wasm imports;mcpsare declaration-only virtual MCP packages. - compile_
script_ owned_ by - Compatibility adapter returning source and fatal failures as diagnostics.
- compile_
script_ owned_ by_ checked - Compiles a script whose code belongs to
owning_packagerather than tomain. - parse_
script - typecheck
- Compatibility adapter returning source and fatal failures as diagnostics.
- typecheck_
checked - Typecheck only — runs the front-end and stops before codegen. Returns
Ok(warnings)when the program is error-free (warnings are non-fatal),Err(diagnostics)if any phase errors. Backssubmilli check. - typecheck_
parsed_ checked typecheck_checkedfor an already parsed script, againststdlib_defs(seeStdlib::package_declarations).- typecheck_
to_ typed_ ast - Typecheck and return the typed AST together with every diagnostic, errors
included. For tools that inspect what the typechecker inferred — the
TypeScript baseline comparison in
crates/conformance— rather than compile. The typed AST is only meaningful where the diagnostics are error-free.