September 22, 2011

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.

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:

Like this:

Related

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