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).

6 thoughts on “Which Smalltalk?

  1. This may be better suited for another post, as opposed to a threaded conversation, but…

    What sort of web projects do you believe Smalltalk and it’s accompanying environments are best for? Since you have experience with PHP (what I generally use for small web projects) what sort of projects would be better suited for PHP, as opposed to Smalltalk?

    • Great question!

      PHP has one great, overwhelming advantage over Smalltalk (and over Ruby on Rails, Python, and Java, too, actually) and that is — ease of hosting. If you want to write an application that will be downloaded and installed on the servers of many users (the WordPress blog is a perfect example of this), or even on a few servers of the clients who buy your software, then PHP is almost certainly the right choice. Rolling out a PHP (+MySQL) application just requires inexpensive web hosting space that everybody with a website has. Deploying a Smalltalk application (though same with Ruby and Python) requires actual shell access, and control over a server (either a physical one or a virtual slice).

      I think, as things stand right now, Smalltalk is best suited for startups (which are creating a web site/application on a server that they control), and for solving hard problems.
      I mean something specific by ‘hard problems’. Database record maintenance (of the creating, showing and updating variety) is a well-understood and easy problem. This is not to say that the implementation won’t be hard — all software is challenging — but you’re not breaking new ground here. Popular web frameworks (like Cake, Zend, Symfony, etc, in PHP world, and Rails in Ruby, Django and web2py in Python) specialize in exactly this kind of work, and should be picked if the scope of the problem is well defined and well understood (like a blog, picture gallery, shopping cart, content management system, etc).
      But if you’re doing something new and difficult (for example, like Trendly which does web traffic analysis visualizations, or DabbleDB, which does crazy custom data transformations — both of these are written in Smalltalk by Avi Bryant, creator of the Seaside framework), or in my case, a web-based game, and you have a short period of time and very few developers on your team, Smalltalk is perfect.

      Here’s an example. A few weeks ago, I could not find a good open-source Twitter clone to run in our company’s intranet (similar to Present.ly or Yammer, but free and downloadable versus hosted), so I proposed to our team – hey, let’s write one. (I’ve just come across this report, though Which Twitter Clone should you choose?, and I need to investigate those alternatives, so as not to reinvent the wheel).
      What framework did we go with? Python/web2py. For ease of hosting (though PHP would be even better for that), and because the application is pretty straightforward db record maintenance (creation and display of small posts), and because we want to turn it into an open source project (and a lot more people are familiar with Python than Smalltalk).

      But. When I was sitting down to design a web based game, with complex interactions and workflow, I immediately went for Seaside (even though I have more experience with web2py or Cake or Rails). It’s more flexible and powerful, and since I don’t have to worry about other users deploying it, or recruiting open source developers, the upside is significant and the downside is minimal.

    • However, having said all of that, don’t let the comment about hosting discourage you from trying Seaside. It is no more difficult to host than Ruby on Rails, and hundreds of thousands of projects are using that.
      Also, my very next series of posts will be on how to deploy remotely a Seaside application.

  2. Hi!

    I was looking for an appropriate Smalltalk environment and found the three above plus the one from Instantiations, VA Smalltalk. Yes, it costs a few bugs, but what about the technology?

    I’d like to find the way back to Smalltalk programming and am looking for a good choice. Years ago I was working with VisualAge for Smalltalk from IBM which is now VA Smallalk. Therefor it is Pharo or VA with Gemstone for me. So, what do you think about VA?

    However, thank you for your thoughts on this page!

    • Hi Ender,
      That’s a good question. I honestly have no experience with VA Smalltalk!
      I’ve worked fairly extensively with Cincom’s VisualWorks Smalltalk, and with Pharo and Squeak, but never tried IBM’s or now Instantiation’s versions.
      It seems to be a pretty good distribution, from what I know.
      Best thing to do is – try it out! And let me know what you think of it! :)

Comments are closed.