Smalltalk and Javascript

For decades Smalltalk was the flagship of object and classes ideas implemented in a language, environment and live image. But it would be a case of “too much, too early”. Different Smalltalks, companies, no open community, hardware requirements, its “own way IDE”, all conspired to become it a niche tool. Meanwhile, new languages from the 90s, from Javascript to Ruby, take leverage from Smalltalk ideas and are more mainstream tools than the original. In this century, Javascript, Ruby, Python, CLR (.NET with many languages), JVM (Scala, Groovy, Clojure! (look ma.. lisp for the masses!)) are gaining momentum. With the emergence of different devices, online apps, and operating systems, most of these new programs can run everywhere. And they are backed up by a vibrant community, with lot of open source projects contributing to the popularity and adoption of these technologies. An example: look at Node.js, a reactor pattern implemented in Javascript, running over V8 Google Javascript engine. It has lot of modules mounted over its core implementation.

Classic Smalltalkers will prefer their environments, but it’s a reality that Smalltalk code could take advantage of existing programming languages, virtual machines and libraries. One promising path is: compile Smalltalk to Javascript, and reach the “run everywhere” dream. (Note Clojure (special Lisp over JVM and CLR) and its new branch: ClojureScript and its rationale). This post is an enumeration of projects that use some variation of Smalltalk to Javascript original idea.

There is the ST2JS (Smalltalk to Javascript translator):

ST2JS – Smalltalk to Javascript translator
http://www.squeaksource.com/ST2JS/

ST2JS – Traductor de Smalltalk a JavaScript (Parte I) (Spanish)
http://diegogomezdeck.blogspot.com/2006/07/st2js-traductor-de-smalltalk.html

ST2JS – Traductor de Smalltalk a JavaScript (Parte II) (Spanish)
http://diegogomezdeck.blogspot.com/2006/07/st2js-traductor-de-smalltalk_28.html

There is an Smalltalk Web Toolkit based on ST2JS (I couldn’t find any source code, yet):

Smalltalk Web Toolkit (Smalltalks 2009)
http://www.slideshare.net/garduino1/swt-2009

Introducción a Smalltalk Web Toolkit (SWT) « CEIBO
http://ceibo.wordpress.com/2008/01/06/introduccion-a-smalltalk-web-toolkit-swt/ (with detailed mini examples of Smalltak to Javascript translations, like closures, blocks, etc)

Nicolas Petton has Amber (formerly JTalk), than creates Javascript files from Smalltalk code (it has an example running on NodeJs, interesting):

ST 4U 133: Amber
http://www.jarober.com/blog/blogView?entry=3493610269

NicolasPetton/amber – GitHub
https://github.com/NicolasPetton/amber

Peter Fisk (VistaSmalltak, GWT Smalltalk, and now SilverSmalltalk) was written Smalltalk using Silverlight, Google tools, and now, Javascript:

Implementing Smalltalk’s Non-Local Returns in JavaScript « Silver Smalltalk
http://silversmalltalk.wordpress.com/2011/02/02/implementing-smalltalks-non-local-returns-in-javascript/

Smalltalk Classes in JavaScript « Silver Smalltalk
http://silversmalltalk.wordpress.com/2011/02/02/smalltalk-classes-in-javascript/

See the Lively Kernel, Javascript inspired by Smalltalk, and JTalk (now Amber):

InfoQ: Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0
http://www.infoq.com/news/2011/08/smalltalk-in-browser

InfoQ: Dan Ingalls on the History of Smalltalk and the Lively Kernel
http://www.infoq.com/interviews/ingalls-smalltalk

Lively Kernel
http://en.wikipedia.org/wiki/Lively_Kernel

There is an open implementation of Smalltalk to Javascript, named S8, work in progress. See Spanish post:

Blog de Leo De Marco: Lanzamiento de S8 en Smalltalking
http://leodemarco.blogspot.com/2011/09/lanzamiento-de-s8-en-smalltalking.html

And yes! You just guess! There is a Smalltalk to Javascript (and maybe other dynamic language) translator in my pet project AjTalk (WIP) (post is comming). I’m working on returns from inside blocks, and some points, like:

doesNotUnderstand for JavaScript?
http://stackoverflow.com/questions/3918920/doesnotunderstand-for-javascript

Is there an equivalent of the __noSuchMethod__ feature for properties, or a way to implement it in JS?
http://stackoverflow.com/questions/2266789/is-there-an-equivalent-of-the-nosuchmethod-feature-for-properties-or-a-way-t

My links:
http://www.delicious.com/ajlopez/smalltalk+javascript

Thanks to @garduino for his links about ST2JS and Smalltalk Web Toolkit. And to @leodmarco for his post about S8.

Keep tuned, more Smalltalk to Javascript experience (using AjTalk) is comming 😉

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

5 thoughts on “Smalltalk and Javascript

  1. Leo De Marco (@leodmarco)

    Great post Angel! I have to say that S8 is intended to not be another SmalltalkToJavascript language, otherwise is the intension to those smalltalkers to survive to their karma: the propietary VM. For that reason, the first approach was to have an Smalltalk running ot the top of V8, but later on we realize that could also have a non-V8 version too, so we open de project to the community. There is no on-line repository yet, wee still have working on it and the page. Anyone interested can write mi al leo@smalltalking.net

    Thanks!

    Reply
  2. Pingback: Javascript: Links, News, Resources (2) « Angel “Java” Lopez on Blog

  3. Pingback: AjTalk and Javascript (Part 1) Abstract Model « Angel “Java” Lopez on Blog

  4. Pingback: AjTalk y Javascript (Parte 1) El Modelo Abstracto - Angel "Java" Lopez

  5. Pingback: Smalltalks 2011 Argentina: Your Conference « Angel “Java” Lopez on Blog

Leave a comment