WebAssembly is widely described as a stack machine, but a closer look at its instruction set reveals it lacks the stack manipulation operations (dup, swap, over, rot) that define real stack machines like the JVM. Without these, Wasm cannot reuse values or perform common subexpression elimination without introducing local variables. This makes Wasm behave more like a register machine with compound expressions encoded in Reverse Polish notation — the stack is just an encoding detail, not a fundamental design. The multi-value extension further confirms this: before it, control flow blocks couldn't interact with the stack at all. The practical takeaway is that experience with traditional stack-based VMs doesn't transfer cleanly to Wasm.
Sort: