@mcc @mega the stack machine that JVM and Wasm have, and the SSA form that LLVM has, are literally equivalent (they are different ways to serialize the same IR, essentially; with the caveat that Wasm forbids irreducible control flow)
if you have your code in SSA/CPS form you would find it easy to emit stack bytecode, if you do not, it is most convenient to use locals (and the runtimes are aware of this and optimize for it)