Image Credit: Dmitris Chloupis

Behold Pharo: The Modern Smalltalk

I am often asked which Smalltalk one should use, as the answer is far from obvious. Smalltalk, you see, is not one language but a family of languages, for example, Amber (for the web), Redline (for the JVM), GNU (for the command line), VisualWorks (for commercial needs).

I usually recommend Pharo. It’s the most rapidly evolving flavour of Smalltalk with an incredible range of innovations since Pharo’s inception in 2008.

My recommendation does not in the least suggest that all other Smalltalk flavours are irrelevant. Indeed, one may consider other Smalltalks for special purposes or niches, such as writing web browser applications, or applications for the JVM, or applications with the Windows native look and feel.

But as a general-purpose open source Smalltalk with great versatility and support, Pharo hits the spot.

Pharo is good for server-side web programming using Seaside and Teapot.

Pharo is good for client-side web programming using PharoJS.

Pharo is good for Internet of Things (or IoT) applications.

Pharo is good for machine learning and data science.

Pharo is being used to fight Ebola!

Pharo is used in wide-scale data visualization for medicines in 16 countries. Also, check out Grafoscopio.

Pharo can even be used to script the Unreal game engine.

Pharo is good for natural language processing.

There are many success stories for Pharo.

Many people have stated that Smalltalk is no longer relevant, that its features have migrated to other more modern languages. This is false on several counts. First of all, it’s not about the individual features but the totality of the language: the whole is greater than the sum of its parts. Smalltalk is supremely small and simple; there’s hardly anything to the syntax, which is entirely based on message passing between objects.

Smalltalk has the cleanest, purest implementation of object-oriented concepts; not even Java, Ruby, nor CLOS can lay claim to that.

Smalltalk’s use of live coding is easy and elegant; not even Common Lisp, Forth, nor Java (hot swapping) can lay claim to that.

Smalltalk’s productivity is known to be 2–5X greater than that of any other language.

None of the “modern” languages share this overall clarity, conciseness, and capability, not Clojure, Elixir, Go, Haskell, Julia, Kotlin, Nim, Rust, Scala, Swift.

This is the reason Smalltalk is held in such high regard.

The whole is greater than the sum of its parts.

Also, Smalltalk is very nicely extensible, just like Lisp.

Let’s compare Pharo to one of these languages, Clojure. It’s the closest and fairest comparison.

Pharo is to Smalltalk as Clojure is to Lisp.

Pharo is a Smalltalk-inspired open source language. Clojure is a Lisp variant for the JVM. Both have rejuvenated these venerable icons of IT.

PharoJS (and Amber) is to Pharo as ClojureScript is to Clojure.

PharoJS, Amber, and ClojureScript are excellent for writing client-side web browser applications. Who needs (or wants) JavaScript and its cacophony of deranged frameworks?

Pharo first appeared in 2008. Clojure first appeared in 2007. Both are contemporary languages with many fine innovations. In recent years, the Pharo project has produced the following:

  • the Glamorous Toolkit, a set of “moldable” extensions to the IDE that allows you to customise the IDE to your workflow.
  • the 64-bit Spur/Cog VM for greatly improved performance. Also, hotspot optimisation with Sista.
  • the Pharo Consortium was created to provide enterprise-grade business support; eventually, Pharo can be an attractive alternative to Cincom’s VisualWorks or Instantiation’s VA Smalltalk, both commercial Smalltalks.
  • PharoJS is a terrific front-end web programming tool.
  • Fuel is a great way to serialize live objects, and for transporting your objects around.
  • Oz allows one image to manipulate another one. Very good for debugging an image that has crashed and is unable to open/load.
  • Pharo Launcher lets you manage your Pharo images (launch, rename, copy and delete) and download image templates (i.e., zip archives) from many different sources to create new images from any template.
  • Shampoo provides good support for Pharo in Emacs; you can replace the Pharo GUI with Emacs and enjoy the benefits of this most powerful editor.
  • just to name a few.

The French multinational engineering giant, Thales, specialising in aerospace and defence, recently joined the Consortium. Pharo has some very serious backers!

Pharo also bears a nice comparison to Elixir. Elixir is a drop-in replacement language for Erlang, a very old language (31 years!) with a great reputation for distributed and concurrent processing. Erlang was inspired by Smalltalk in the sense that all Erlang processes communicate by message passing. Erlang processes are isolated units of computing that hide internal state.

This was, in fact, Alan Kay’s vision for Smalltalk, and “objects” were supposed to be like a networked system of computers. Of course, today object-oriented programming has been bastardised to be nothing more than code organisation. Witness Java, C++, and Scala. Alan Kay rues the day he used the term “objects.”

Interestingly, PharoJS is to Smalltalk as Elixirscript is to Elixir. Like PharoJS, Elixirscript is good for client-side web development.

Elixir, then, is an updated language for Erlang’s BEAM environment, and in this sense, it’s like Pharo, which is an updated language for modern computing.

And finally, let’s compare Pharo to another “modern” language, Haskell, which is 27 years old! Haskell has achieved a modest level of popularity in recent years, thanks to the current craze in (pure) functional programming. Pharo is much newer and delivers all the power of Smalltalk in a modern context. As you can see, “old” languages can always surprise us in new ways.

Here’s the key similarity: Haskell is renowned for its mathematical rigor and elaborate type system in functional programming. Pharo is renowned for its purity and elegance in object-oriented programming, hewing closely to Alan Kay’s vision. As Haskell’s time has come to fulfill its destiny, so has Pharo’s.