This should be good. I wonder how they are going to deal with WASM’s inability to do tail call elimination. A bytecode VM on top of WASM?
I’m assuming the timing isn’t a coincidence: https://webassembly.github.io/tail-call/core/
I prototyped a compiler from pure functions to WASM which embeds everything into trampoline actions. This isn’t quite enough for e.g. Haskell or other non-strict setups, but it should work for Scheme, OCaml, etc.
I think that, in general, targeting WASM means doing something like GHC’s strictness analysis. We need a “stack-only” analysis and a “locals-only” analysis which isolates sections of code that don’t need to make calls or recurse. This is complicated by the fact that WASM doesn’t allow embedding irreducible control flow without some sort of intermediate stack frame.