A Dynamic Forth Compiler for WebAssembly
In yet another ‘probably-useless-but-interesting’ hobby project, I wrote a Forth compiler and interpreter targeting WebAssembly. It’s written entirely in WebAssembly, and comes with a compiler that dynamically emits WebAssembly code on the fly. The entire system (including 80% of all core words) fits into a 10k (5k gzipped) WebAssembly module. You can try it out here, or grab the code from GitHub. What follows are some notes on the design, and some initial crude speed benchmarks.
More Fun with Monad Do-notation in Scheme
In a previous post, I played around with monad do-notation in Scheme (well, Racket) to have a nicer syntax to play with asynchronous callbacks. This do-notation is actually quite fun to use with other monads as well. What’s interesting is that the same notation gets entirely different meanings and forms depending on which monad you use it with. There are many interesting monads, and this post shows only a couple of simple ones in action in Scheme (for which you can find the code here).
Flattening Callback Chains with Monad Do-Notation