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.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//! 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user