Hi Sea
Well, I certainly don't know what I'm talking about after 50 years ...
Squeak and messaging
Squeak did not bring anything new to messaging. It was a 6 month project by 5
of us to simply make a framework for development -- so it was made from an
early version of Smalltalk-80 that Apple owned, and what was interesting about
it was the way it was developed and the changes in the underpinning -- in
particular Dan Ingalls and John Maloney made some really great design decisions
about how to do the bootstrap, make it highly multi-platform, etc. See "Back To
The Future" http://www.vpri.org/pdf/tr1997001_backto.pdf
Metasystems
The first 100 pages of "The Art of the Metaobject Protocol" (MOP) is worth
reading. One of the examples is drawn from the following kind of problem.
Suppose the implementation of your object system uses indexed arrays as a way
to implement instances for really fast runtime variable lookup. But suppose you
want to make some objects that might have hundreds of possible properties, but
generally will only have a few dozen at any given time (for example, many kinds
of graphic objects can be like this). You would like to use sparse arrays
(maybe a hash table) for instances, and somehow insert this alternative way
safely into your dynamic language.
This can be done in Squeak, but not so directly in its official metasystem (but
can be done by adding to the interpreter, which is also in Squeak). But suppose
Squeak had a "Class Instance" that held the official way of implementing an
instance from an array, etc., *and* could be subclassed (this is where you
would provide the hash table way to do an instance). The key here -- and when
you can say you have a metasystem that rocks -- would be if the system could
automatically move from your model of the new kind of instances to
automatically informing the compilers etc., so that your changes would run as
fast as they could.
This is one of the examples in the MOP book. As they say "most implementations
are really a *point* in an implementation space, but what you really want is
for the MOPs to create *regions* that efficiently embody useful tradeoffs.
This never got done in Squeak -- but it is a very worthwhile way to think about
metasystems and issues that require pragmatics to go along with good semantic
relationships.
Similarly, one could imagine wanting to make from Squeak a system with real
messages that could embody some of the Dave Fisher ideas from "A Control
Definition Language" ca 1970. (The default could be the procedure call
sub-message that Squeak generally uses.) You'd both like to do this and you
would need the results to be speedy.
Assignments and Functions
A read only variable and a function have similar behaviors (they always return
the same value). An assignment statement changes this invariant -- so it is
semantically equivalent to changing function definitions on the fly! This is a
different metalevel (and a more dangerous one). It moves us from being able to
reason relatively easily about what a program might do, to making it very
difficult to reason in many important cases. So a lot of work has been done by
a small percentage of computerists over the years to try to deal with this
problem (it is similar to the problems McCarthy encountered where he wanted to
do mechanical deduction *and* he wanted his robots to be in different states).
Tail recursion in Lisp provides an interesting way to thing about this. You are
always using only *old* values to compute all the new values for the call, so
there are no race conditions. Tail recursions can be rewritten as loops, and
the computation and call can be rewritten as simultaneous "assignments" which
have no bad properties. Several interesting languages were made from these
properties. Lucid is one of the most interesting.
If you use McCarthy's ideas to make "pseudo time" then you could imagine
advancing a whole system of objects from one pseudotime to the next with never
a race condition. I think this is a good idea, and we have experimented with
various manifestations of it over the years.
Meta-again
Changes in meta levels can have enormous ramifications in what a system does,
can do, and being able to reason about it. You can imagine wanting these to be
under program control, but to at least raise cautions and alarms if a
programmer starts to do metachanges via program control
Cheers,
Alan
------------
Alan,
I'm thinking more deeply about computers and language and
have realized that, after programming for 15 years, I still have no idea what
I'm talking about :)
After reading many of the LISP suggestions (thanks), the
primary features seem to me to be:
• parsimony
(again you got to me and I finally looked it up; "extreme unwillingness to
spend money or use resources")
o little
syntax - you can learn the language in 5 minutes
o uniformity
- everything from variables to procedures are treated the same.
• power
- a meta-system where you can change anything e.g. the order the arguments are
processed in, what syntax is legal, etc.
• I'm
not sure where, if at all, security comes in
So, now on the way to ESUG, I've come back to what makes
Smalltalk valuable and I came across
http://www.c2.com/cgi/wiki?AlanKayOnMessaging
I'm shocked (but not really, given that the idea of
Smalltalk had already passed into the religion phase) that this did not lead to
a massive, enlightening thread on the Squeak list.
Here are my thoughts and questions:
The big idea is "messaging" - that is what the
kernal of Smalltalk/Squeak is all about (and it's something that was never
quite completed in our Xerox PARC phase).
To me this says that Squeak brought something new to the
"messaging" table beyond St-80. Is that right, and if so what did it
bring? Etoys?
"realize that a good metasystem can late bind the
various 2nd level architectures used in objects"
This seems like a real pot of gold, but I'm not sure I'm
grokking it. Would you give a concrete example of what you're talking about (in
any language)? Does Smalltalk do this? In the example about assignment that
follows, I don't see how the meta-system is involved, which I think of as
things like Behavior>>allSubclasses
"assignments are a metalevel change from functions, and
therefore should not be dealt with at the same level"
What makes them so?
Even though I encapsulate my domain concepts, inside my
objects I write (and see everywhere in Smalltalk) code which seems to violate
what you're saying. Like if I was modelling a web page, maybe I'd have an
instance creation method Webpage class>>at: aUrl; then during
initialization:
Webpage>>setUrl:
aUrl
contents
:= aUrl retrieveContents contents.
...
So here again is assignment mixed with functions (or do you
really mean "functions" and not messages as here?). But what is the
alternative? A WebpageContents class? What would the benefit be?
"I would say that a system that allowed other
metathings to be done in the ordinary course of programming... is a bad
design."
Is this a problem with LISP, where a macro can e.g.
magically change what gets passed to the evaluator?
Gratefully,
Sean
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc