Squik language features

Bryce Kampjes bryce at kampjes.demon.co.uk
Tue Apr 15 17:43:44 UTC 2003


Hi Anthony,
Your project sounds interesting. I'm definitely interested in hearing
more about it.

One of the long term goals of Exupery is to provide a better platform
for language design and implementation experiments.

Anthony Hannan writes:
 > Hi Michael,
 > > Also, a more general question. There are no instance variables and you 
 > > can only assign to them by doing #instVarAt:...
 > > Now, this is a great idea, but will you be making "a := 2." shorthand 
 > > for "myObject #instVarAt: 4 put: 2."?
 > 
 > No, you would use the accessor instead, as in "self a: 2".  The
 > assignment operator (:=) will be reserved for temps only.

What is the reason for using instVarAt:put: methods? I'm guessing it's
to provide a nice interface to change variable behavior with.

At the bytecode level Squeak already has this with the push and pop
bytecodes. The names are removed in compilation. Of course there is no
way to override anything at that level. Python has a mechanism to
change the semantics of variable access, I don't know the details.

Why do you want flexibility to redefine variable access? Flexibility
is great to provide a platform for language designers but too much
flexibility in a language means all programming becomes language
design.  It is often the ability to reason about sentences that makes
a language useful to a programmer. For instance the lack of macros in
Smalltalk makes it possible to reason based on surface syntax without
needing to look at the method (potential macro) definition.

Could the flexibility be provided at compile time? Say, a method in
the class that provides a template for generating both readers and
writers. This would mean only the classes that use the facility need
to pay for it at run-time.

For instance, working in Smalltalk when you regularly corrupt the
image (running bad machine code) makes it much harder to reason about
where bugs are. Especially if the image was probably corrupted days
ago and is corrupt on disk, the symptoms only emerging much later due
to some completely unrelated activity. All the fun of Smalltalk
programming with all the fun of C programming.

Bryce



More information about the Squeak-dev mailing list