3 ms·
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
by CyberRabbi 6y ago
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.
This is evident by the lack of “dup” and “swap” instructions which are critical to passing data around in a pure stack machine.
- bcheung 6y agoThe purpose of an intermediary virtual machine target is that it abstracts away details like that. It's not that registers won't be used at some point, it is about encapsulation, working at the right level of abstraction, and separating it from underlying hardware concerns.
- CyberRabbi 6y agoI don’t get the purpose of your comment. Are you saying WASM isn’t a good intermediary virtual machine target because it provides locals? If so, I never said it was. I was simply clarifying a claim made in the OP.