Changes between Version 1 and Version 2 of LoritoPrimitives

Show
Ignore:
Timestamp:
08/09/09 14:54:02 (12 years ago)
Author:
cotto
Comment:

add a field for an example Smalltalk snippet

Legend:

Unmodified
Added
Removed
Modified
  • LoritoPrimitives

    v1 v2  
    11The 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. 
    22 
    3 Because most Parrot developers are not familiar with Smalltalk, so the following table lists the primitives used to implement Squeak (available [http://www.cosc.canterbury.ac.nz/wolfgang.kreutzer/cosc205/squeak.html here]), a description, their equivalent in C syntax and an appropriate name for the Lorito op. 
     3Because most Parrot developers are not familiar with Smalltalk, so the following table lists the primitives used to implement Squeak (available [http://www.cosc.canterbury.ac.nz/wolfgang.kreutzer/cosc205/squeak.html here]), example Smalltalk code, a description, their equivalent in C syntax and an appropriate name for the Lorito op. 
    44 
    55Memory access goes through a set of 6 macros for reading and writing single bytes, 4-byte words and 8-byte floats.  
    66 
    7 ||Squeak primitive||description||C equivalent||Lorito op|| 
    8 ||& ||||||||  
    9 ||| ||||||||  
    10 ||and: ||||||||  
    11 ||or: ||||||||  
    12 ||not||||||||  
    13 ||+ ||||||||  
    14 ||- ||||||||  
    15 ||* ||||||||  
    16 ||// ||||||||  
    17 ||\\ ||||||||  
    18 ||min: ||||||||  
    19 ||max:||||||||  
    20 ||bitAnd: ||||||||  
    21 ||bitOr: ||||||||  
    22 ||bitXor: ||||||||  
    23 ||bitShift:||||||||  
    24 ||< ||||||||  
    25 ||<= ||||||||  
    26 ||= ||||||||  
    27 ||> ||||||||  
    28 ||>= ||||||||  
    29 ||~= ||||||||  
    30 ||==||||||||  
    31 ||isNil ||||||||  
    32 ||notNil||||||||  
    33 ||whileTrue: ||||||||  
    34 ||whileFalse: ||||||||  
    35 ||to:do: ||||||||  
    36 ||to:by:do:||||||||  
    37 ||ifTrue: ||||||||  
    38 ||ifFalse: ||||||||  
    39 ||ifTrue:ifFalse: ||||||||  
    40 ||ifFalse:ifTrue:||||||||  
    41 ||at: ||||||||  
    42 ||at:put:||||||||  
    43 ||<< ||||||||  
    44 ||>> ||||||||  
    45 ||bitInvert32 ||||||||  
    46 ||preIncrement ||||||||  
    47 ||integerValueOf:||||||||  
    48 ||integerObjectOf: ||||||||  
    49 ||isIntegerObject: ||||||||  
     7||Squeak primitive||example Smalltalk code||description||equivalent C code||Lorito op|| 
     8||& |||||||||| 
     9||| |||||||||| 
     10||and: ||||||||||  
     11||or: ||||||||||  
     12||not||||||||||  
     13||+ ||||||||||  
     14||- |||||||||| 
     15||* ||||||||||  
     16||// ||||||||||  
     17||\\ ||||||||||  
     18||min: ||||||||||  
     19||max:||||||||||  
     20||bitAnd: ||||||||||  
     21||bitOr: ||||||||||  
     22||bitXor: |||||||||| 
     23||bitShift:||||||||||  
     24||< ||||||||||  
     25||<= ||||||||||  
     26||= |||||||||| 
     27||> |||||||||| 
     28||>= |||||||||| 
     29||~= |||||||||| 
     30||==|||||||||| 
     31||isNil|||||||| 
     32||notNil|||||||| 
     33||whileTrue: ||||||||||  
     34||whileFalse: |||||||||| 
     35||to:do: |||||||||| 
     36||to:by:do:||||||||||  
     37||ifTrue: |||||||||| 
     38||ifFalse: |||||||||| 
     39||ifTrue:ifFalse: ||||||||||  
     40||ifFalse:ifTrue:||||||||||  
     41||at: ||||||||||  
     42||at:put:||||||||||  
     43||<< ||||||||||  
     44||>> |||||||||| 
     45||bitInvert32 ||||||||||  
     46||preIncrement ||||||||||  
     47||integerValueOf:||||||||||  
     48||integerObjectOf: ||||||||||  
     49||isIntegerObject: ||||||||||