[Long][Only partially humorous]Re: Syntax & Sematics [was: Re:
[Enough already] Re: Proposal3:
Bijan Parsia
bparsia at email.unc.edu
Tue Jun 6 05:50:17 UTC 2000
I just must be in an extended fey mood. Must be something in the air...
...like allergens!
On Mon, 5 Jun 2000, Andrew C. Greenberg wrote:
> >I want Squeak because its the best.
> >
> >And I want it to have "pluggable" syntax.
>
> How, exactly, does one hope to maintain a system of any size or
I usually close my eyes *really tight*, put one hand on each side of my
head, and do a kind of shaking thing while going
"pleasepleasepleaseplease" under my breath really fast.
Of course, this doesn't seem to work that well for regular Smalltalk
code...but I'm still a-hoping! (pleasepleasepleaseplease...)
> written by a group of any size where each component is written in its
> own "pluggable" syntax?
More seriously, there are several different issues:
1) multiple syntactical "views"
2) multiple (perhaps not directly mappable) syntaxes, aka
syntactical extentions
3) multiple semantics
4) multiple languages (both syntax and semantics)
I'm sure there are more categories, but I'm not telling you about the
others ;) For each, there's a nice canonical (in virtue of my listing
it) example, to wit:
1) the squeak alternative syntax (and pretty printers, really,
especially if they do things like displaying _ for := and
so on; the proposal for optionally inserting _s in identifiers
is another example)
hm.. the #define { begin (or however it works) trick is a good
example of evil in this category ;)
2) Lispy macros. Here you *extend* or *alter* the syntax. But the
essential *semantics* remains the same. The main effect is to
change coding patterns. If one has a desirable semantic effect
that is tedious or error prone to use given the standard syntax
you define an alternative way of getting "at it".
I actually put things like inspectors into this category,
though they're non-linguistic.
UML vs. the Squeak tile scripts might be a good example of 2
vs. 1
Ooo, the Smalltalk-72(?) per class syntax might fall here.
SSPs (Squeak server pages) fall here, I think. They are an
excellent example of a simple syntactical change that
is both very useful and probably not difficult to manage.
3) Any MOPy thing will do. Adding mulitple inheritence to
Smalltalk. Things like SOUL. Here, you minimally touch the
syntax but radically change the syntax. Done right, this is
way cool. Done wrong, this is death.
If the syntax added is minimal, I would probably put it here.
Type annotations, espeically minor ones, might fall here.
4) Prolog/V (Prolog in Smalltalk, available for Squeak). The
Prolog and MacLispy interpreters. Apple's OSA. The poplog
system. OpenDoc and similar (corba based?) system.
If SSPs grew more complex, they might fall here.
I'd also put the lisp notion of building little domain/
application languages. Sometimes this seems to reduce to
2 or 3, but heck, this is a continum of sorts ;)
So, we can rephrase the question:
What the hell happens to maintainability in the presense of each
member of the powerset of 1-4 in a disparate group of any
reasonable size?
Answer: Depends :)
And it depends on a lot of things. I'm going to look at it from
the point of view of the single (shacking up is ok) person "living" in
Squeak.
1) This shouldn't bother me (the single person, not Bijan, not
Bjarne) since I see everything *MY WAY* regardless of what
the other sickos do.
Presuming, of course, that implementers do things right.
But that's always true.
2) This is serious. Or can be. At lot depends on how onerous
the expanded form is, and how domain specific the macro is.
Alan keeps describing the sytnax per class thing as cool
but ultimately unwieldy. So this one I'd want to see
the proposal and it would be nice to have a *biiig* fence :)
But the Lisp way seems to work for Lisp. And this *can* be
a powerful and *good* force for language evolution.
I must say that I love the idea of syntax as just another
tool in the IDE.
3) This is serious. A good mop is worth having. A good fence is
worth having.
But evil people can ruin my life with this. *Which* object
model am I using now?
Again, Lisp (espeically Common Lisp) points a
way. Unfortunately, that's typically a way for *experts*. I
do think one can do better for us small fry.
4) This is cool! This is *terrific*. We *already* have it with
Slang. (Though that's a minor deviance. The prolog is better.)
Thinking back, again, to Lisp, Lisp machines, while lisp from
top to bottom, had compilers for Fortran, C, Pascal, etc. So
you could write programs in all these languages from the comfy
home of Lisp. I'd like to write Prolog, Scheme, Python,
from the comfy home that is Squeak.
Two things are key: Good support from the tools, and a good
...er..."local function interface" (LFI). Poplog, for example,
has standard mechanisms for getting at all the other langauges
from any one of them (Common Lisp from Pop, ML from Common
Lisp, etc.)
One very cool thing about Prolog/V is the 'is' operator unifies
between Prolog and Smalltalk expressions. That's *elegant*.
The most obvious integrative method is to let me write methods
in different langauges (prolog, python, smalltalk). Sure, if
you-the-Python-ignoramous hit my method, you won't know what
I'm doing there. But heck, if I wrote a primative you would
know, and if you've ever looked at *my* Smalltalk, you might
well prefer my Python! :)
Clearly, problems would have to be fixed by those in the know.
If it really bugged you, you could translate it to your
prefered version.
Obviously, having nifty backtranslations from bytecodes would
be cool, if somewhat painful to read.
A lot rests on the "done right" or the "done well", but don't it
always? And the standard I was to me, IIRC from way back at the beginning,
was "hope" :)
Cheers,
Bijan Parsia.
P.S., I did some thinking/work toward some of this for Casbah project.
(http://www.casbah.org) (now pretty much defunct in that incarnation)
If you poke around there, you'll find lots of ramblings ;)
P.P.S. Obligatory mention of Guile.
P.P.P.S. Gratuitous mention of my sweetie's getting into the local paper:
http://www.news-observer.com/standing/collections/creators/4969.html
Though, frankly, her eyes are *not* cobalt. I *checked* against
color swatches. Sheesh. Can't trust reporters nowadays! ;)
More information about the Squeak-dev
mailing list
|