On 12/31/06, Francis Cianfrocca <garbagecat10 / gmail.com> wrote:
> On 12/31/06, M. Edward (Ed) Borasky <znmeb / cesmail.net> wrote:
> >
> > >>> And if it's more efficient to
> > manage two or three stacks than dozens of registers, I think you want a
> > stack machine and not a register machine.
> > <<<
>
>
> You haven't established that it is more efficient. I'm completely
> sympathetic to leveraging the strengths of particular hardware platforms as
> available, but observe that most mainstream hardware is register-based.
> High-quality register-based code is far harder to automatically generate
> than stack-based (try it sometime), but you have more potential to squeeze
> performance out of the machine by bypassing memory-bus cycles. Again, try it
> sometime. It's not easy to do, and I surmise that some of the attractiveness
> of the stack-based model comes from its simplicity. And also from the fact
> that every register-based piece of hardware is different, so you're leaking
> multiple abstractions into VM-level code where it arguably doesn't belong.
> Does this make stack-based VMs axiomatically better-suited for dynamic
> languages as opposed to languages like Java? I have no idea how to even
> approach answering that question.
>

Doesn't this mapping imply generating platform-specific machine code
directly from the code that targets your V-ISA?
To my knowledge, Parrot isn't planning to do this. (Feel free to
correct me with a link I missed on Google, though.)

That is a big, big job requiring more machine-level expertise than has
yet arrived in the #rubinius IRC channel. Heh.

That's the basic thrust of my argument against register-based VMs.
Conceptually, the idea of having 'hard' mappings between virtual
registers and architected registers is cool. Actually implementing it
means basically reinventing gcc inside your project. Also, given that
by far the largest target platform is x86, and it has a tiny number of
gprs, you're going to be doing a lot of shuffling anyway. Why not let
a compiler handle that for you, since they spend all day, every day,
working on making it good at that task?