WAForth: Forth Interpreter+Compiler for WebAssembly

WAForth is a bootstrapping Forth interpreter and dynamic compiler for WebAssembly. You can see it in a demo here.

It is entirely written in (raw) WebAssembly, and the compiler generates WebAssembly code on the fly. The only parts for which it relies on external (JavaScript) code is to dynamically load modules (since WebAssembly doesn’t support JIT yet), and the I/O primitives to read and write a character to a screen.

Parts of the implementation were influenced by jonesforth.

WAForth is still in an experimental stage. It implements most of the ANS Core Words, and passes most of the Forth 200x Test Suite core word tests.

el-tramo.be/waforth
https://github.com/remko/waforth

Leave a comment