[virtmach] bytecodes and stacks

Ewald Pfau ehp@ear.co.at
Mon, 29 Nov 1999 19:54:24 +0100


Ian Piumarta <Ian.Piumarta@inria.fr> wrote:

vi> One stack is always enough.  

Two stacks is not luxury. More may be. Only when having explicitely a
_data_ stack, so the concept of a lifo data-store is implementable. When
limited to _one_generic_ stack (as most part of programmer's world seems
to be) this will sooner or later turn out less to be a stack but more a
frame, bound to procedures.

Procedures nest and un-nest - this is a stacking requirement which
should not be confused with a lifo data-store. Seen from Forth (which
builds on two stacks), it is regrettable that Java has been introduced
with one stack only. Before, Sun did better with a VM for two stacks.