[Vm-dev] VM Recipe: How to build an interpreter VM on Linux

Clément Bera bera.clement at gmail.com
Sun Feb 7 19:32:21 UTC 2016


2016-02-07 1:21 GMT+01:00 gettimothy <gettimothy at zoho.com>:

> "How does the interpreter VM differ from the stack VM in the Cog branch?
>  I'm familiar with what Cog and Spur bring to the table, but not how
> these older VMs differ. (or for that matter if I should even be
> considering these VMs 'older'... are there situations where they are
> still recommended on platforms where Cog, and now Spur, are supported?)
> Thanks,
> Phil
> "
> IIRC the difference is how Blocks are implemented with the Stack VM
> improving on the Interpreter VM. Block Closures vs Block Contexts are the
> terms you are looking for.
> I have been away from it too long to comment on the matter, but that
> should point you in the right direction.
I am not sure this is correct. BlockClosures were introduced in the
Interpreter first, before the StackVM was created. I don't know the current
status but I think the interpreter VM either supports BlockClosures or both
BlockContext and BlockClosures.

The main difference between the Stack VM and the Interpreter VM is that the
contexts are mapped to a call stack in the stack VM for execution instead
of being executed as context, the name Stack VM comes from this mapping
(Btw I built a tutorial in smalltalk explaining both execution stack
management if you are interested pm me). There are also little differences
that Eliot introduced while building the StackVM such as nil, true and
false are fixed at the beginning of the heap or primitive are cached in the
global lookup cache by caching the function pointer instead of the
primitive numbers. Is the gnuification part of the Interpreter VM too ? If
not that's also a difference.

Anyway, today I think the Stack VM can run on any platform the Interpreter
VM can. There are maybe cases where it can still make sense to use the
Interpreter VM, but they are very specific and uncommon.
Understanding the VM is perhaps the most notable case as the StackVM
introduces quite some complexity.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160207/9618db3a/attachment.htm

More information about the Vm-dev mailing list