[squeak-dev] Balance of metrics

Jecel Assumpcao Jr. jecel at merlintec.com
Mon Mar 12 23:38:29 UTC 2018


Tim Rowledge wrote on: Mon, 12 Mar 2018 11:29:08 -0700

> Eliot & I were talking about it a while back and  IIRC thought that it would
> be practical these days to have an "I'm sending this message to myself"
> send, along with some futzing when doing lookup. With inline caching I
> don't think it would have any measurable effect on performance. Basically
> if the method is private then it simply isn't 'seen' during lookup unless
> the send is a self-send. Or something like that.

Self does have such a bytecode, as you might expect from the name of the
language. And the semantics was subtly different from pushing "self" on
the stack and then doing a normal send to that, but it isn't what I
wanted to talk about.

For Self 1.0 multiple inheritance with priorities was implemented and so
was privacy. Inheritance was done with "parrent slots" which had "*" at
the end of their names. So if an object has a slot named "mommy*" with
the value "globals rectangle" then it inherits rectangle behavior. If it
also has a slot named "daddy***" with the value "globals texture" then
it also inherits texture behavior, but not as strongly (more "*" makes
inheritance weaker). If you send a message that is both rectangle-like
and texture-like the first will be chosen.

But you might have parents with the same priorities and in that case a
"tie breaker rule" is applied. When you combined this with private vs
public slots, then it was often the case that the actual method that got
executed was not at all what the programmer expected. Each feature
seemed simple enough, but their combination was too complicated.

David Ungar liked to say this was Randy Smith's fault for going away to
England and leaving him and his students at Stanford to play around
without proper supervision. When the group moved to Sun and Randy joined
them, they removed parent priorities, the tie breaker rule (it was now
an error for there to be more than one possible method, so the program
would have to be manually rewritten to eliminate the ambiguity) and
privacy was no longer enforced (though they stayed on as documentation
and showed up in the Self 4 GUI as bold face vs normal method names).

The subjective languages Us and Korz were later attempts to properly
deal with these problems.

-- Jecel


More information about the Squeak-dev mailing list