argument count

Jecel Assumpcao Jr jecel at merlintec.com
Wed May 8 23:13:50 UTC 2002


I was able to borrow an iBook to check out Self 4.1.5 yesterday (note - 
since I don't know how to set up the SELF_WORKING_DIR variable the 
droplet didn't work) and was interested in seeing how the new "argument 
count" bytecode was used. I does make an interpreter's life easier, but 
the code expansion is a bit too much. An interesting alternative would 
be to define the two remaining opcodes as "send1" and "selfSend1" and 
only use "argument count" for the rarer cases of two or more arguments.

One thing that seemed surprising to me was the direct evaluation order 
of the arguments, with the receiver ending up buried in the stack. I 
thought we used the reverse order with the receiver on top, so I 
checked in Self 4.0 and saw that it too used the direct order. In fact, 
my tinySelf 1 does too (as it had to, in order to work with Self 4.0 
images) so I obviously knew this a few years back. My tinySelf 0 parser 
did generate code to evaluate things in the reverse order but since it 
only read in sources and not snapshot I never noticed this mistake. I 
checked Craig Chambers' thesis but his single example of bytecodes only 
has unary messages and could be interpreted either way.

The simple embedded Self hardware I am designing (a 16 bit machine 
described in http://www.merlintec.com:8080/hardware/oliver) does 
evaluate arguments in the reverse order, so translating Self bytecodes 
to its native machine language will be a little more complicated than I 
had hoped. I have investigated alternative, such as the KMachine 
(http://fare.tunes.org/tmp/emergent/kmachine.htm) which are a much 
better fit for the direct order evaluation but that will have to wait 
for a larger project than this one.

-- Jecel



More information about the Self-interest mailing list