[Vm-dev] InterpreterSimulator and Primitive Code convention
David T. Lewis
lewis at mail.msen.com
Wed Dec 2 16:50:03 UTC 2009
On Tue, Dec 01, 2009 at 08:44:43AM -0800, Andreas Raab wrote:
> David T. Lewis wrote:
> >I do not know why it was done that way.
> I do. The idea was to add type annotations to a snippet of code that
> could be helped a lot by translating them to C but doesn't inherently
> require it. For example John Maloney "prototyped" the sound prims, then
> threw in the required type annotations so we could translate them to C
> and speed them up by few orders of magnitude.
> It does make sense if you think about the issue in the way that this is
> code with type annotations to make them translatable instead of thinking
> about them as primitives that can also be run directly.
Thanks for this explanation. I updated the class comment for
MiscPrimitivePlugin as follows:
This plugin pulls together a number of translatable methods with
no particularly meaningful home. See class>translatedPrimitives
for the list.
The primitives in this plugin consist of various methods in the
image that can benefit greatly from translation to C, but that do
not inherently require translation. These may be thought of not as
traditional primitives, but as methods that have been annotated for
translation to C by this plugin. This approach allows performance
critical methods to be written entirely in Smalltalk, then marked
for translation as needed to achieve improved performance.
More information about the Vm-dev