[Self-interest] argument parents (was: general ifTrue)

Jecel Assumpcao Jr jecel at merlintec.com
Thu Dec 16 17:54:32 UTC 2021

On Thu, 16 Dec 2021 12:37:23 -0300, I wrote:
> Note that the 'send' bytecode isn't really needed except to save a
> little memory. In theory each activation has a :self* argument parent
> slot so this bytecode would do the exact same thing:
>    implicit self send 'self'

When designing NeoLogo in the 1990s, I thought it might be interesting
to explore this idea of argument parents as an alternative to assignable
parent slots.

When Urs was developing Self 3 he asked for existing Self code to test
his new compiler with so I sent him my CMOS simulator. He thanked me but
said he couldn't use it since I had used assignable parents extensively
and, though his compiler supported this, it was a very poor

The reason I used this feature in my simulator was that the Self prompt
was the command line for my tool and by making each circuit a parent of
its subcircuits you could refer to stuff with relatively short names.

After that exchange with Urs I came up with a way of speeding up some
uses of assignable parents but it was somewhat awkward and, like going
from a normal PIC to a megamorphic PIC, performance would fall off a
cliff beyond a certain number of different parents.

I noticed that I did not actually ever change a parent after I had
cloned an object. Perhaps that use case would be better expressed as
setting a value of an argument once and for all, like in theory :self*
is set when the activation is created?

In NeoLogo objects were just specially formatted Logo lists and you
could append a new list to an old one to make the old act as a parent.
For something more Self-like it would be possible to have a more elegant
and very efficient implementation of argument parents. They would be set
when a prototype was cloned and the new object's map would be defined by
a combination of the prototype's map and the parent's map. All of the
Self VM optimizations would then apply as normal.

-- Jecel

More information about the Self-interest mailing list