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:
2026-03-29 22:14:53 +02:00
commit 683281363d
33 changed files with 5084 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
//! Optimization passes for WAFER's IR.
//!
//! Each pass is a function `Vec<IrOp> -> Vec<IrOp>`, composable in sequence:
//! 1. Constant folding
//! 2. Strength reduction
//! 3. Peephole optimization
//! 4. Inlining
//! 5. Dead code elimination
//! 6. Stack-to-local promotion
// TODO: Step 11 - Optimization pass implementations
#[cfg(test)]
mod tests {
#[test]
fn placeholder() {
// Optimizer tests will be added in Step 11
}
}