[Q] stackbased/registerbased VM

Bijan Parsia bparsia at email.unc.edu
Sat Dec 13 16:08:03 UTC 2003


On Sat, 13 Dec 2003, Hans-Martin Mosner wrote:
[snip]
> Stack based VMs were pretty common at the time (and still are). They map
> very nicely to the nested syntax structures common in programming
> languages and generally lead to simple compilers, which are easier and
> less error-prone to implement.

The VMs themselves are also, I'd say, simpler.

> Register based VMs probably can lead to faster dynamic translators to
> real machine code if the target has an adequate number of real registers.
> Sadly, the world's dominant PC CPU hasn't.

And just easier compilation to machine code.

I saw a claim that regbased is easier to program manually:
	http://lambda.weblogs.com/discuss/msgReader$9789?mode=day

> Off the top of my head I don't see really significant advantages of
> register-based VMs...
[snip]

I seem to recall that they were claims (by Rscheme folks?) that regbased
could be significantly faster. (Though I can't recall if this was
inherently, or do to optimization opportunity.)

Some discussion:
	http://lists.tunes.org/archives/virtmach/2002-July/000317.html

The Warren Abstract Machine (WAM) is register based, IIRC.
	http://www.vanx.org/archive/wam/wam.html

(The slides are nice.)

Many, if not most, Prolog implementations are based on a WAM like
architecture, as are many Prolog derivatives (e.g., Mercury)

Cheers,
Bijan Parsia.




More information about the Squeak-dev mailing list