My Week With Squeak

a critique

Preamble

Before I get started, as I imagine that this may generate a fair amount of vitriol, I'd like to clarify my intent. Even after my brief experience with it, I'm really very impressed by the elegant and self-consistent model of how everything works. The "browser" metaphor for editing code is a very good one, the syntax is easy to read, and some impressive metaprogramming/metaobject hacking is possible.

In fact, given Smalltalk's history, it frustrates me greatly that it hasn't taken over the world by now; especially now that squeak, a fast and robust open-source1 implementation is available. I am interested in helping it do so; but I think that there are several basic issues that need to be resolved. Some of these are being worked on, some are not; some can't be worked on by individuals, but instead are just intended to be consciousness-raising for the community.

The Good Stuff

I downloaded the Squeak package for Linux from the main squeak site, untarred it on my Debian machine, and I was up and running in seconds! 8.4 megs seemed like a hefty download, but I'm on DSL, so it only took a minute.

The first few minutes with Morphic was what got me hooked. I right-clicked on a window, rotated it 45 degrees, and kept using it... unbelievable. Nothing I'd ever used could do that, and that sort of feature is really hard to bolt on unless the GUI is designed from the ground up to have some knowledge of itself. And Morphic is actually written in a high-level language! I tried other stuff, too -- dragging and dropping widgets out of the web browser and onto my "desktop", playing Flash animations, constructing small things out of the bits in the "supplies" tab. I even did a 'load code updates', and was impressed to see that there seemed to be some APT style functionality for managing upgrades built into the base image!

Aided by a smalltalk-savvy friend, I navigated the System Browser and Method Finder and to discover the joy of a fully reflective programming environment. Wow! I can just say "What implements this?" "What calls this?", and "What does this class look like?". I've often wished for features like that when I've worked in other environments. "Explore" blew me away yet again; being able to interactively inspect any object that's resident in memory could be *really* helpful!

After spending some time wandering around the system and trying out the various eye-popping demos, I decided to settle down and actually do some work. As an exercise to learn the language and environment, I decided to implement an IRC client (as the one in the standard distribution looked minimally functional at best).

And that's when the trouble started.

The Bad Stuff

There is no clear way to write an application in smalltalk. From the minute I understood what an "image" file was, I realized that this could be an interesting issue, but the real deep problem is that the community (or at least Squeak Central) doesn't seem to take this seriously, since it's certainly possible to create custom image files that do what you want your application to do. It seems like the attitude is that writing software that will last for more than a few months involves maintaining a fork of some version of the baseline virtual machine yourself.

In search of someone else's answer to this problem, I scoured the net for changesets, loading everything that I could. I downloaded approximately 50 changesets, and every single one either gave me a walkback upon filein or conflicted with another seemingly innocuous changeset in such a way that a basic task (opening a Browser window, or better yet, entering the debugger) would give me a walkback.

Strangely enough, there was a really positive aspect to that part of the experience. I got to use the debugger to fix up some of the simpler changesets I cared about (NewLook and SyntaxHighlighting) and it was smooth as silk; even when I was regularly nuking the debugger window by making changes to the appearance of scrollbars, the emergency evaluator let me back out my change, look at what was wrong with it, and make the appropriate fix.

Unable to find good examples externally, I turned to the applications embedded in the image. The IRC client was unusable; Celeste corrupted my image by doing something I can't understand to my fonts (and I couldn't debug it; since my default system font was set to a font consisting of nothing but asterisks, I couldn't understand any of the debug output the walkback gave me); Scamper extends its tendrils too thoroughly throughout the system for me to make sense of it, or even to figure out what is and isn't "Scamper" (String asUrl!? Object isWebBrowser?!?!).

Despite the pleasantness of the debugger, the sea of broken links, broken instructions, and broken code only gave me three conclusions to jump to:

  1. The open-source segment of the squeak and smalltalk community in general is a bunch of slobs who just write broken code and expect their users to deal with it and/or fix it.
  2. Nobody actually uses squeak for anything but writing the squeak VM, and it is in fact unusable for anything else.
  3. It is nigh impossible to actually write and maintain a significant amount of code which stays current with the SqC image, despite many heroic efforts to the contrary; so you have to have 6 or 7 different images lying around that you can actually run squeak code.
Various things about my investigations into the squeak community show me that conclusion number 3 is probably the true one, but I could easily see a frustrated, but slightly less curious person than I in the same situation jump to 1 or 2, and go back to their previous language of choice. It is my sincere hope that the Stable Squeak project will fix this, and make most of this little rant invalid in 2 months time. :)

The Ugly Stuff

Although my initial impression of Morphic was "wow, neato!", trying to work with and code to it was a disillusioning experience. It manages to combine the worst aspects of every UI I've ever used; it is inconsistent, slow, ugly, devoid of visual cues, not streamlined, at once not configurable enough and too configurable, buggy, lacking in features, and poorly documented.

One at a time, I'll substantiate those claims:

Why It's Worth it Anyway

While these problems are certainly significant, and even if the community were already 100% dedicated to fixing them, it would take a while to get to the point where they were all solved, they are at least theoretically solvable.

I don't believe that, for example, giving Python real automatic orthogonal persistence, or speeding up the interpreter by a factor of 10 to 25, is solvable in any practical timeframe. Or making C or C++ a reflective language. Squeak solves some very basic problems pretty well, and addresses issues that most other environments and languages just ignore.

However, making the virtual machine modular, adding namespaces, fixing the UI [etc] is a difficult, but eminently possible task. The problems I've enumerated here are some of the things I hope to work on as I work with Squeak.

Indeed, we're headed "back to the future", but it will take a while to get there.


Well, mostly open-source. It's not OSD/DFSG conformant, but it's good enough for me.
Glyph Lefkowitz
Please send feedback! Last modified: Thu Apr 19 03:29:39 CDT 2001