Expand description
formawasm — WebAssembly component backend for the formalang IR.
See README.md for the project spec and CHANGELOG.md for the
phase-by-phase history. This crate re-exports the upstream IR
types it consumes so callers do not need a separate formalang
dependency to use the backend.
Re-exports§
pub use component::ComponentWrapError;pub use component::wrap_component;pub use layout::ArrayLayout;pub use layout::EnumLayout;pub use layout::FieldLayout;pub use layout::LayoutError;pub use layout::RangeLayout;pub use layout::StructLayout;pub use layout::VTableLayout;pub use layout::VariantLayout;pub use layout::plan_array;pub use layout::plan_enum;pub use layout::plan_range;pub use layout::plan_struct;pub use layout::plan_vtable;pub use lower::BindingMap;pub use lower::FunctionMap;pub use lower::LowerContext;pub use lower::LowerError;pub use module::ModuleBuilder;pub use module_lowering::ModuleLowerError;pub use module_lowering::lower_module;pub use preflight::PreflightError;pub use survey::PublicSurface;pub use types::TypeMapError;pub use wit::WitEmitError;pub use wit::emit_wit;
Modules§
- component
- Component-Model wrap layer.
- dwarf
- DWARF debug-info emission for the wasm core module.
- layout
- Memory-layout planner for every type the backend lays out in linear memory.
- lower
- Per-expression lowering from formalang IR to core-Wasm instructions.
- module
- Builder for the core WebAssembly module the backend assembles during code generation.
- module_
lowering - Bridge between the formalang
IrModuleand the core-WasmModuleBuilder. - preflight
- Pre-flight rejection of IR shapes the backend cannot handle.
- survey
- Classification of an
IrModule’s top-level items into exports, imports, and exported types. - types
- Mapping from formalang
ResolvedType/PrimitiveTypeto core-wasm value types. - wit
- WIT-document generation for the component boundary.
Structs§
- EnumId
- ID for referencing enum definitions.
- Function
Id - ID for referencing standalone function definitions.
- IrFunction
- A function definition in the IR.
- IrFunction
Param - A function parameter in the IR.
- IrFunction
Sig - A function signature in the IR (without a body).
- IrImport
- An import from another module. Tracks which types were imported from external modules so codegen can emit proper import statements.
- IrImport
Item - A single imported item from a module.
- IrModule
- The root IR node containing all definitions.
- IrTrait
- A trait definition in the IR.
- Pipeline
- A composable sequence of IR passes.
- Struct
Id - ID for referencing struct definitions.
- TraitId
- ID for referencing trait definitions.
- Wasm
Backend - Backend that lowers a typed IR module to a WebAssembly component.
Enums§
- Pipeline
Error - Error produced by a
Pipeline. - Resolved
Type - A fully resolved type.
- Wasm
Backend Error - Errors produced by
WasmBackend::generate.
Traits§
Functions§
- optimize_
core_ module - Run binaryen’s wasm-opt over a core-Wasm byte slice and return the optimized output.