[self-interest] Re: Grammar changes - comments?
gordon at cichon.de
Thu Sep 2 19:03:15 UTC 1999
Steve Dekorte wrote:
> I don't know about the other Self fans out there, but my attraction to
> Self has to do with the power of it's namespace and object model, not
> it's syntax.
I think so, too. Self has a simple and general object model which makes
it elegant. The object model is almost as expressive as the much hyped
and never come out "object model" of Cyc. And it consists only of
communicating objects - no classes, no variables.
What I also like about Self, and Smalltalk/V was the kind of "multi
language paradigm". Some things can be expressed more easily with
one grammar, some with another. IMHO most of the "grand unified
languages" become some sort of clumsy at certain problems.
Well, when thinking about Self as an object model, I would like to
propose the following extensions to the Self system:
1) Allow arbitrary objects as object annotations.
There are several different aspects of "declarative knowledge"
embedded into annotations other than pure comments. Putting
them into regular objects would provide a clean interface for
adding other interesting types of annotations to slots.
Imagine, you could put some sort of assertions into the annotation,
or you could descibe some high level mathematical properties
of your objects with the annotation. (BTW, an optimizing compiler
could use this information to generate good code out of this)
This would open a "dual space" - some kind of declarative
counterpart - to the otherwise purely behavioral "knowledge"
of self programs.
The question I ask myself is, should these annotations be just
like Self objects used to be, or should they be a kind of special
objects (say: functions, clauses) designed to represent declarative
(BTW, this is a complementary approach to mirrors which try
to separate behavioral and declarative aspects, whereas annotations
try to integrate these aspects possible)
2) Replace bytecodes by something else.
When you have a look at the Self object system, there is objects and
messages. No classes, no variables, nothing that's not absolutely
necessary. And it is implemented efficiently with tagged
pointers, maps, objects ond the heap and on the stack, and a lot
of other things.
When I have a look at the Self bytecodes, I feel that it is an efficient
implementation of something else.
Well, I think I owe you the answer what this might be. I have to
admit that I do not have a clear answer to this right now. It seems to
be something like an abstract syntax tree.
It currently has only two kinds of nodes: a send (which is directed
either to nobody special or to the result of another send, and takes some
arguments which are sends in turn), and a sequence operator that
performs several sends one after another.
This is the basic functionality of sequential programs.
Looks like the behavioral counterpart of the lambda calculus.
What would happen if you added nodes like receive or a parallel
operator, as they are found f.e. in Occam? What is a relationship
between a channel, a receive, and an object?
What do you think about these ideas?
More information about the Self-interest