It’s misleading to say that WASM has no registers in the virtual machine. Function locals behave very much like a static set of registers. The stack machine is mostly used to encode expression computations but ultimately data shuffles around through locals and not through the stack.<p>This is evident by the lack of “dup” and “swap” instructions which are critical to passing data around in a pure stack machine.
WebAsm: Forth with Lisp Syntax. Overview of WebAsm text format, with example.
(note: The code is tested and works, however, live example not loading since bitbucket won't send the correct content-type application/wasm for .wasm files; instead sending text/plain)