BYTE.com > Mr. Computer Language Person > 2004
Self, Slate, and Prothon
By Martin Heller
May 31, 2004
(Self, Slate, and Prothon
: Page 1 of 1 )
The year was 1987. The current version of MS-DOS was 3.3, and the hot new operating system for 80286-based computers was OS/2. At Stanford University, researcher Randall B. Smith and his group were working on a new language called Self, which Smith and David Ungar designed at Xerox PARC in 1986, and described at OOPSLA '87. The Self project moved to Sun Microsystems Labs in 1991, and continued through 1995.
Self is an object-oriented programming language and associated programming environment. It is close in spirit and semantics to Smalltalk, but it is simpler and more concrete. Self has no classes: It implements object inheritance more directly.
In Self, an object is made up of slots. A slot has a name and contains a reference to an object. All of an object's state and behavior is contained in its slots. Messages are matched with slots by name. Slots can be methods or data.
In Self, when we want a new object, we find an existing one and copy it. We can then change the copy, safe in the knowledge that we have not affected anything else. The master object from which all objects of the same type are copied (directly, or indirectly via another copy) is known as a prototype.
A traits object contains only shareable state and behavior, intended to be used by inheritance. Unlike a class, it does not mandate a particular storage structure in its descendants. It is usually incomplete (i.e., it does not implement all the messages it send to self; these are to be implemented in descendants). Any object which implements the appropriate messages can inherit from the traits object.
Blocks are Self closures, similar to anonymous functions (lambdas) in Lisp and functional languages. Self implements multiple inheritance by allowing multiple parent slots. Self also allows assignment to parent slots, which gives it dynamic inheritance. Self has its own thread system, including a scheduler and semaphores.
I have to admit that I never programmed in Self: It ran (and runs) on machines from Sun Microsystems, on the Macintosh, and on the PowerPC, and I never had any of those long enough to do anything significant with them.
Page 1 of 1
BYTE.com > Mr. Computer Language Person > 2004
|