Which Smalltalk?

[Edit: Updated February 2014]

When starting any project, a developer has to navigate a tree of choices. Which programming language do I choose? Which distribution? Which editor or IDE should I use with it? Which operating system should I target? Sometimes, the decision is easy since the environment is dictated by management: we’re a C# shop, so fire up VisualStudio on Windows and go. Or, we’re using Ruby, so pick your favorite code editor (TextMate, vim, Emacs, Eclipse) and you’re off, since you’re limited to pretty much one official Ruby distribution. Same with Python, or Perl — pick an editor and your favorite *nix OS (Windows support is more shaky for all these scripting languages), and you’re set. Sure, there are often experimental or alternate VMs and interpreters, but the mainstream production choice is clear.

Not so with Smalltalk. Much like with Lisp, a casual user first approaching the Smalltalk world is faced with a bewildering variety of Smalltalk versions. Which distribution and virtual machine (and therefore a slightly incompatible dialect and set of libraries) should you choose?

Fortunately, a bit of research narrows down the choices. Especially if you want to use the Seaside web development framework. Your options are:

Commercial Smalltalk Vendors

Open Source Smalltalk Projects

  • Squeak Smalltalk
  • Pharo (forked from Squeak in 2008, to take the project in a more Enterprise direction, and still under very active development)

Let’s run down the choices that I made in starting this project.

Q: Which programming language? A: Smalltalk
I have worked with Smalltalk for over 9 years, both as my day job (writing desktop applications in Visual Smalltalk and Cincom’s VisualWorks), and as a hobby (exploring Squeak Smalltalk). Though I have also worked on commercial projects using Java, Perl, PHP, Python and Ruby/Rails, I have not found anything in those worlds resembling Smalltalk’s powerful IDE and ease of debugging. Though the other languages enjoy a wider base of developers, open source projects, and third-party library support, the experience of working with Smalltalk (and Seaside) is profound, freeing and satisfying.

Q: Which Smalltalk? A: Pharo Smalltalk
Although the GLASS platform intrigues me, I don’t have much experience with it. And, given a choice, I always prefer to work with open-source technology rather than commercial distributions, hence the choice of Pharo (which I feel has more long-term longevity and openness) over VisualWorks (even though that has better commercial support, I don’t want to deal with license fees at this stage in the project).

So why Pharo and not Squeak? Although I’ve worked with “plain Squeak” for a number of years, the Pharo fork seemed like a reasonable choice, since it was chosen to be the reference implementation for the Seaside platform (perfect, exactly what I need it for). While I originally made this choice around 2009, having watched the Pharo community grow and blossom over the years, I do feel that currently (as of 2014) Pharo is the overwhelmingly correct choice (for web development).

Edit: The original reasons that I posted for choosing Pharo were:

a) removing unessential code from Squeak (Squeak, having started as a children’s education project, has accumulated a fair amount of cruft over the years), b) clearer licensing (MIT license), c) more frequent updates (think Ubuntu versus Debian), and d) being a reference implementation for the Seaside platform (perfect, exactly what I need it for).

However, as this thread on Pharo-Project mailing list pointed out, most of them are incorrect. My apologies for misunderstanding — I got those reasons from the Pharo Wikipedia entry when I came across the Pharo fork, and was trying to figure out whether to switch or not.

Q: Which version of Pharo? A: Pharo 2.0 (with testing on 3.0)
As of Feb 2014, Pharo 2.0 is the “current/stable” version, and 3.0 is undergoing active development. So far, I have not seen too many problems with interoperability, so I generally develop on 2.0, and make sure the tests pass on 3.0.

Q: Which IDE? A: Pharo
Unlike most programming languages, the code editor and IDE is often built into the distribution/VM (though the IDE code can be stripped out when getting a VM image ready for deployment). This may sound strange, but it buys you incredible debugging and refactoring powers. Like in Lisp, both the source code and the (on-the-fly) compiled methods and classes are first-class objects, so with a single keystroke, you can do things like “Show me a list of all the methods called from this method” or “Give me a list of all the other places in the code this function is called from” — something that has to be approximated with full-text searches in other IDEs and environments.

Q: Which operating system? A: Doesn’t matter, actually
Most of the main Smalltalk distributions are cross-platform, with the virtual machine and IDE working almost identically on Windows, Linux and MacOS X. Currently, I do development on Mac OS X or Ubuntu Linux (depending on which machine I’m working on), and deploy to a web server running Ubuntu.

I hope this sheds some light on this very individual set of decisions. One last thing I’d like to reiterate: If you’re new to Smalltalk and Seaside, you essentially can’t go wrong with the main distributions (VisualWorks, VA Smalltalk, GLASS or Pharo). All are excellent cross-platform environments, and the choice between them comes down to commercial support, licensing fees (and, in the case of Gemstone, whether or not you need a first class object-oriented database).

Welcome – Seaside Thoughts and Tutorials

Welcome. Over the course of this blog, I would like to share my thoughts and experiences on web development on the Seaside framework using the Smalltalk programming language.

My current project is to implement a Web MUD (an excellent example of this genre is Kingdom of Loathing), a text-based persistent online game with a web interface, using Riak as a persistence engine. But specifically, this blog focuses on general areas of interest to current Seaside users, and those interested in learning more about this amazing and flexible framework.