Achieve 100% Core compliance, implement CATCH/THROW

Core word set: 0 errors on Gerry Jackson's forth2012-test-suite/core.fr
- Fix POSTPONE for non-immediate words via COMPILE, mechanism
- Fix double-DOES> (WEIRD: pattern) with does-body scanning and
  runtime patching via _DOES_PATCH_
- Implement CATCH/THROW exception handling using wasmtime trap
  mechanism with stack pointer save/restore
- 232 tests passing
This commit is contained in:
2026-03-30 21:26:21 +02:00
parent 6d3b7c5a89
commit 2c74222193
6 changed files with 881 additions and 13 deletions
+4 -7
View File
@@ -6,7 +6,7 @@ An optimizing Forth 2012 compiler targeting WebAssembly.
## Status
WAFER is a working Forth system. It JIT-compiles each word definition to a separate WASM module and executes via `wasmtime`. 219 unit tests passing, 3 errors on the Forth 2012 Core test suite.
WAFER is a working Forth system. It JIT-compiles each word definition to a separate WASM module and executes via `wasmtime`. 232 unit tests passing, **0 errors on the Forth 2012 Core test suite** (100% Core compliance).
**Working features:**
@@ -117,10 +117,7 @@ tests/ Forth 2012 compliance suite (gerryjackson/forth2012-test-suite sub
### Not Yet Implemented
3 remaining Core test failures:
- `POSTPONE` for non-immediate words in IMMEDIATE context (GT5)
- Double-DOES> in one definition (WEIRD: W1)
- `: NOP : POSTPONE ; ;` meta-programming pattern
All Core words implemented. Exception word set (CATCH/THROW) also available.
## Compliance Status
@@ -128,10 +125,10 @@ Targeting 100% Forth 2012 compliance via [Gerry Jackson's test suite](https://gi
| Word Set | Status |
| ------------------ | ------------------ |
| Core | **97%** (3 failures on test suite) |
| Core | **100%** (0 errors on test suite) |
| Core Extensions | Pending |
| Double-Number | Pending |
| Exception | Pending |
| Exception | **CATCH/THROW implemented** |
| Facility | Pending |
| File-Access | Pending |
| Floating-Point | Pending |