« ARCHIVE Home | Email msg. | Reply to msg. | Post new | Board info. Previous | Home | Next

Prg=WaForth with Turtle Graphics and Interactive Shell

By: Fiz in ARCHIVE | Recommend this post (0)
Fri, 19 Aug 22 12:55 AM | 76 view(s)
Boardmark this board | Article Archive
Msg. 00024 of 00164
Jump:
Jump to board:
Jump to msg. #

http://github.com/remko/waforth

WAForth is a small but complete bootstrapping Forth interpreter and dynamic compiler for WebAssembly. You can see it in action in an interactive Forth console, and in a Logo-like Turtle graphics language.

WAForth 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.

The WebAssembly module containing the interpreter, dynamic compiler, and all built-in words comes down to 14k (7k gzipped), with an extra 15k (7k gzipped) for the JavaScript wrapper, web UI, and encoding overhead.

WAForth implements all ANS Core Words (and passes Forth 200x Test Suite core word tests), and many ANS Core Extension Words. You can get the complete list of supported words from the interactive console.




» You can also:
« ARCHIVE Home | Email msg. | Reply to msg. | Post new | Board info. Previous | Home | Next