Version 1 (modified by cotto, 12 years ago)

initial version; needs help from someone who knows Smalltalk

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 primitives implemented in C with the rest of the language being implemented in terms of these primitives. In hope of jumpstarting the design and implementation of Lorito (aka L1), this page lists the 42 primitives used by Squeak's VM. Hopefully a similar set of primitives can be used as Lorito ops.

Because most Parrot developers are not familiar with Smalltalk, so the following table lists the primitives used to implement Squeak (available  here), 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 primitivedescriptionC equivalentLorito 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: