A different view of Smalltalk

Doug Way dway at mat.net
Thu Aug 19 06:48:01 UTC 1999


On Tue, 17 Aug 1999, Bob Arning wrote:

> Recent discussions started me thinking about different ways to display,
> understand and manipulate Smalltalk code. SyntaxMorph is an experiment
> that provides a graphical representation of Smalltalk syntax with popup
> menus to identify, examine and browse individual features. A SyntaxMorph
> view of a method can be created by selecting "BOBS SYNTAX" from the
> browser message list menu.

Very well done!

I had actually thought of the basic idea a few months ago of having a
simple "syntax helper", which would draw boxes around Smalltalk code in
order to make the order of operations obvious.  Your implementation is
nearly identical to what I was thinking, oddly enough, but you've taken it
a step further with adding the pop-up menus.  (I was thinking only in
terms of display.)

The only significant difference between yours and my imagined layout was
that I wanted to preserve the layout of the source code.  This would make
it easier to compare with the original source, and might make text editing
easier, but it would have other problems (the boxes would be a lot uglier
than yours, some non-rectangular...).

> Questions to answer:
>
> 1. Can this provide useful information to beginning Smalltalkers?
> Intermediate? Advanced?

I'd say the benefit to beginners could be *huge*, as some others have
said.  Not necessarily as a replacement for editing source, but as a
go-along helper.  The Smalltalk syntax can be a little tricky for
absolute beginners to pick up... distinguishing variables from unary
messages, determining the exact order of operations in long statements,
etc.  A beginner could bring up your tool alongside a method, and the
answers to these problems become instantly visually obvious.  No more
"hard to learn" syntax! :)

I'm less sure about the benefit for intermediate/advanced Smalltalkers,
some of the usual advantages/disadvantages of graphical syntax tools come
into play here... one problem is that these tools often take up a lot more
screen space than simple text source code.  But the context-sensitive
pop-ups are very nice for finding senders/implementors, etc.  Being able
to drag and drop chunks of code would be very cool too, as someone else
mentioned.

Also, as some additional food for thought, you might try to integrate this
tool with the debugger, since the currently highlighted bit of source in
the debugger as you stepped through it would correspond to one of your
boxes (SyntaxMorphs).

Keep it up,

- Doug Way
  dway at mat.net





More information about the Squeak-dev mailing list