Files
WAFER/crates/core/src/codegen.rs
T
ok 683281363d Initial commit: WAFER (WebAssembly Forth Engine in Rust)
Optimizing Forth 2012 compiler targeting WebAssembly with IR-based
compilation pipeline, multi-typed stack inference, subroutine threading,
and JIT/consolidation modes. Rust kernel with ~35 primitives and Forth
standard library for core/core-ext word sets.
2026-03-29 22:30:18 +02:00

22 lines
684 B
Rust

//! WASM code generation from IR.
//!
//! Translates optimized IR into WASM bytecode using the `wasm-encoder` crate.
//! Supports two modes:
//! - **Typed mode**: when type inference succeeds, values stay in WASM locals
//! - **Fallback mode**: load/store against stack pointer globals in linear memory
// TODO: Step 5 - Full codegen implementation
// - IR -> WASM function body translation
// - Single-word module generation (JIT mode)
// - Multi-word module generation (AOT/consolidation mode)
// - Typed vs fallback mode selection
// - Function table management
#[cfg(test)]
mod tests {
#[test]
fn placeholder() {
// Codegen tests will be added in Step 5
}
}