tunes and self

Jecel Assumpcao Jr
Thu, 15 Oct 1998 22:49:08 -0200

A while back a few aspects of the Self programming language were
mentioned here. While there is certainly some overlap between that
project and Tunes, there are enough differences that made me decide to
keep my Self-based project separate from Tunes.

In a way, Self has been moving away from Tunes. Craig Chambers created
the first Self compiler and invented some very sophisticated type
analysis schemes. He went even further in Self 2.0, though that made the
system less interactive since all that processing was happening at
runtime. Self 4.0 is based on the "type feedback" system by Urs Hoelzle.
There are two compilers - the first one is very fast but dumb and
generates instrumented code. When bottlenecks in system execution are
identified (the "hot spots", which is the name Sun currently uses for
this technology), they are recompiled with a more sophisticated compiler
which doesn't do type analysis but instead gathers its type information
from the previous runs of the code (as compiled by the dumb compiler).

While the results of type feedback and type analysis are very similar in
practice, they differ considerably in theory. Type feedback will always
only show you a subset of all possible types for some expression, so you
always have to check for "unknown". Type analysis is much more precise
and could prove that this expression can only be of one of three types,
and no others. This should make the code generated by type feedback much
worse, but they make use of the fact that the compiler is always present
at runtime to do "uncommon case elimination". They simply guess that no
other types besides the ones seen so far will be encountered but if it
ever happens then the code says "oops!" and calls the compiler to go
over the code again and fix this mistake.

I love these kinds of "hacks", but my guess is that they don't fit the
Tunes philosophy very well. Craig Chambers has continued his research
direction with the Cecil programming language. It has a better
theoritical foundation than Self (though I don't think it is as fun) and
has neat stuff like multi-dispatching and predicated classes.

For everyone interested in Self, I have set up a mailing list to discuss
it (and one about the Merlin project too - see the web based
subscription forms for both lists on the Merlin home page in the link
below) which you can subscribe to by sending an empty message to


-- Jecel Mattos de Assumpcao Jr -- mailto: