Amber vs PharoJS


There are two somewhat different approaches to using Smalltalk for the web. The first is Amber, which is more than four years old. It’s a fairly mature implementation of Smalltalk with good support. Amber is currently used in a number of places, including Sebastian Sastre’s living full-stack framework for the web known as flow.

Amber works much like JavaScript frameworks such as Ember. You start with a HTML/CSS design and wire up web components with Smalltalk business logic. It’s sort of like using HTML templating, but not.

The second is PharoJS, which was created in 2015. It gives the Pharo development environment primacy by letting you write your entire web app using Pharo tools, which include live coding and debugging. When you’re ready to deploy, your app is transpiled to JavaScript which you then integrate into your HTML. This nascent project has some ways to go before it is ready for production use, but it’s worth taking a look at it now.

Which one you choose for web development depends on your priorities. Amber is more mature and feels more familiar to JavaScripters. In fact, Amber maintainer Herbert Vojčík calls Amber “Smalltalk for JavaScripters in the browser,” whereas PharoJS is essentially “Smalltalk in the browser for Smalltalkers.” PharoJS is heavily Pharo-oriented.

In principle, since Amber operates very closely at the JavaScript level, Amber can potentially integrate with JavaScript frameworks such as AngularJS. There isn’t much demand for that at the moment, but Amber is better positioned than PharoJS, if and when demand increases. Amber and Angular should be a killer combination!

Amber has had wider adoption thanks to its age. Users will get better support from the community. It is not obvious that PharoJS will still be around five years from now. The degree of adoption remains to be seen after PharoJS becomes production-ready.

If you’re interested in Amber, look at this tutorial trilogy.