Improvements to Self?

Ian Woollard ian.woollard at tesco.net
Wed Aug 8 23:08:36 UTC 2001


Hi! Self interested people!

I used to run Self 4.0 on a Sun system. It was kinda fun, but a
bit limited in some ways- portability was quite poor; and some
of the language concepts were a bit more irregular than I would
have liked.

Here are some of the ideas I have to improve it; I'd welcome some
comments:

a) 'references'

Consider:

a: b + 1

I think that a: should not be a slot. Instead 'a' should return a
reference object; sending the message ':' to it would update the value.

In the case of 'b' it should also return a slot object as well. Passing
'+' to it would not be recognised, and would be overridden in the
reference object to return the value b, which would then be passed
the message.

The idea is that the compiler/interpreter could optimise this away
as the message would typically either match or not match for any given
use. (There's a few wrinkles here I'm glossing over, but you should have
the basic idea.)

b) 'Allow optional parameters'

For example, Self could have an object called 'Button' that might
have optional parameters to set the font, size etc. This can reduce
the size of APIs considerably. This allows Self to become a decent
scripting language.

c) No lexical scoping

Methods instantiations should inherit off an assignable slot, that is
set to point to self. Statements should inherit off method
instantiations. This simplifies the language, and regularises it.

(Again the compiler can optimise this away.)

d) Privacy

Some mechanism is needed for this. The minimal implementation is a slot
that can only be accessed when called from a method found in a slot of
self; but that's a bit cumbersome to code with. (If that sounds 
completely bizarre, don't worry, there are much better implementations.)

Anyway. What do people think? Good/bad/implementation X does that already...

-- 
- Ian Woollard (ian.woollard at tesco.net)

"Is a planetary surface the right place for an expanding technological 
civilization?"
- Gerard O'Neill




More information about the Self-interest mailing list