[Vm-beginners] Difference between SmartSyntaxInterpreterPlugin and InterpreterPlugin

Bert Freudenberg bert at freudenbergs.de
Tue Mar 8 08:32:13 UTC 2011


On Mar 7, 2011, at 11:55 PM, Mariano Martinez Peck wrote:

> Hi, after the talk of Igor in Deep Smalltalk School, I wonder which is the difference between SmartSyntaxInterpreterPlugin and InterpreterPlugin. From the class comments I cannot see it, and it seems each of them has its own subclasses. So, what is the difference?

In InterpreterPlugin you need to pop arguments from the stack yourself. SmartSyntaxInterpreterPlugin generates that code for you if you use the #primitive:parameters:receiver: declaration. 

> if I write my own plugin, which one should I subclass from?

SmartSyntaxInterpreterPlugin is nicer to use since you don't have to code all the stack counting and argument checking yourself. However, it does not work quite as well with the simulator, at least the last time I looked.

Personally, for library bindings I subclass SmartSyntaxInterpreterPlugin, because those won't work in the simulator anyways. If I intend to simulate, I use a plain InterpreterPlugin subclass.

Would be cool to "finish" SmartSyntaxInterpreterPlugin so it can always be used, and reduce the boiler-plate code even more.

- Bert -


More information about the VM-beginners mailing list