[self-interest] Self on top of Squeak

Stefan Matthias Aust sma at 3plus4.de
Thu Nov 18 23:50:12 UTC 1999

I like this idea, too (this is my second email, please read Self in Java
first).  I already did some work in Smalltalk and it integrates quite well
into the system.  For mySelf, I used VisualWorks as I'm most familiar with
this system and it's the fastet I know.  However, mySelf works also in
Squeak - with some minor changes to the Squeak system (the smalltalk parser
needs to accept "_" as valid symbol character and not (only) as assignment
operator - which should be := anyhow ;-)

So is it difficult create a prototypical, Self-language based system on
Squeak - in the next, say, 3 months, ready for use in March 2000?  I don't
think so.  All you need to add for Self semantic is true delegation and
dynamic multiple inheritance.  If that works - make it fast.

I've already a Squeak 2.6 VM variant which can do delegation based on a

 delegate: selector withArguments: array to: delegatee

primitive function.  It's a trivial modification.  It would break if the
delegated method would contain instance variable refences but that's not my
problem.  Simply don't use them anywhere but in primitive accessors.  I'm
currently working on multiple inheritance which should be that difficult
either, although my patch will slowdown the whole system.  Basically, my
idea is to check in method lookup whether the class's superclass slot
contains an array instead of a single class.  In this case, I expect a list
other classes I'll search.  I know, this isn't exactly the Self semantics,
but hopefully close enough for a first try.  It's a simple
multiple-inheritance patch.

To make it look more like Self, I might want to store a list of indices
into the current method holder object (aka the object whose class I'm
looking at at the moment) Now these object's classes are considered as
candidates for the right method.  I'm afraid this will still get into
conflicts with the current lookup caching but perhaps some VM-experts can
help out here.

Eventually, to support Self-style primitives, simply call as ordinary
Smalltalk methods.  Make sure, that all Self-style-objects share a common
super class which is the place to implement the primitives.  It could also
overwrite #doesNotUnderstand to check for primitives and raise a better error.

My original Self parser was buggy, but it's my intend to port the
(hopefully) correct parser I wrote in Java back to Smalltalk - and to
Squeak.  Then you could probably compile CompiledMethods with
Self-semantics which can interact with the normal Squeak-System.

Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf.

More information about the Self-interest mailing list