Version 3 (modified by cotto, 5 years ago)

s/primitive/operation/ - primitive means something different in Smalltalkland

The VM for the Smalltalk interpreter Squeak has a design similar to our eventual goal for Parrot, namely that it has a small core of operations implemented in C with the rest of the language being implemented in terms of these operations. In hope of jumpstarting the design and implementation of Lorito (aka L1), this page lists the 42 operations used by Squeak's VM. The hope is that a similar set of operations can be used as Lorito ops.

Because most Parrot developers are not familiar with Smalltalk, so the following table lists the operations used to implement Squeak (available  here), example Smalltalk code, a description, their equivalent in C syntax and an appropriate name for the Lorito op.

Memory access goes through a set of 6 macros for reading and writing single bytes, 4-byte words and 8-byte floats.

Squeak operationexample Smalltalk codedescriptionequivalent C codeLorito op
&
|
and:
or:
not
+
-
*
//
\\
min:
max:
bitAnd:
bitOr:
bitXor:
bitShift:
<
<=
=
>
>=
~=
==
isNil
notNil
whileTrue:
whileFalse:
to:do:
to:by:do:
ifTrue:
ifFalse:
ifTrue:ifFalse:
ifFalse:ifTrue:
at:
at:put:
<<
>>
bitInvert32
preIncrement
integerValueOf:
integerObjectOf:
isIntegerObject: