4 ms·
> I include, especially, stack-oriented bytecodes ... WASM uses stack-oriented bytecode for simplicity and to make static analysis easier, not just for tersene
by zozbot234 3y ago
> I include, especially, stack-oriented bytecodes ...
WASM uses stack-oriented bytecode for simplicity and to make static analysis easier, not just for terseness. (Arguably, the real underlying issue with stack-oriented bytecode is the amount of stack fiddling you have to include in more complex programs. It also does not generalize cleanly to parallel execution, unlike, e.g. dataflow or even register-based SSA.)
- kragen 3y agoin general smalltalk-80 and similar stack bytecodes include almost no stack fiddling; the only stack-manipulation bytecodes included are dup and drop, not even swap or over. instead of stack fiddling, you have load and store bytecodes—in smalltalk, you usually have them in precisely the places the source program had atomic expressions in, respectively, rvalue or lvalue contexts. this simplifies the compiler and also allows you to use a decompiler instead of storing the source code even on the f18a core in chuck moore's latest designs from greenarrays, there's no swap; you have dup, drop, over, and r> and >r (called push and pop). and of course the way he generalized it cleanly to parallel execution is by putting 144 computers on the same chip, each with separate ram. the code is also pretty compact but not in a way that's practical for bytecode interpretation on a byte-oriented computer