BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0

Smalltalk IDEs Come to the Browser: Jtalk, tODE, Lively Kernel 2.0

This item in japanese

Smalltalk implementations have always had tight integration with IDEs, starting with the very first ones created by Dan Ingalls and Alan Kay at Xerox PARC.
IDEs and developer tools have started coming to the web, eg. Cloud9, or use HTML and Javascript GUIs like RЅtudio (RStudio uses GWT) or the WebInspector that's shipped with WebKit browsers. Some Smalltalk implementations have started down that path too.

tODE is a web browser-based frontend to the capabilities in a Pharo (a version of Squeak) and GemStone Smalltalk. tODE brings HTML/Javascript versions of the various browsers (class browsers, etc) to the web browser. The tODE approach makes sense for applications written with the Smalltalk web framework Seaside; it's possible for a developer to use the web application and in case of breakpoints or exceptions makes it possible to be transported straight into the debugging tools - right there in the web browser. The tODE approach also brings inspectors to the browser to help look at the components generated by Seaside.

The first version of tODE 0.1 has just been released and currently works with Pharo and GemStone. The tODE website has a simple way of trying tODE: download the one click application which brings a Pharo VM and image set up for tODE. On launch, start tODE  and point a web browser at http://localhost:8080.
A similar approach has been tried by Cincom with WebVelocity.

Another approach to Smalltalk in the browser is to create a Smalltalk runtime that runs on the Javascript VM. Jtalk is a Smalltalk that uses the Pharo grammar (with a few modifications, eg extension for inline Javascript). The Jtalk compiler is written in Jtalk and compiles straight to Javascript. Some of the solutions of Jtalk can be traced to Avi Bryant's Clamato project, including the use of the PetitParser, a Smalltalk-based PEG parsing library written in Lukas Renggli.
As most Smalltalks, Jtalk comes with the development tools to write, read, and browse available classes; on the Jtalk website, pressing the button "Class browser" pulls up the IDE, including a REPL ("Workspace"). The beginnings of a debugger have been added to Jtalk GitHub repository. The code in the browser can be edited and committed back to a WebDAV server (see documentation on how to use JTalk with a WebDAV server).

Jtalk compiles Smalltalk code to Javascript, and as such has to deal with some of the issues of the Javascript platform. Jtalk creator Nicolas Petton explains the problems of implementing Smalltalk's DNU (doesNotUnderstand, similar to Ruby's method_missing) functionality.
In short, implementing the feature requires that all call sites need to check if a method exists in the receiver, if not it invokes the DNU specific handlers.
Gilad Bracha, one of the creators of the Newspeak language, has recently mentioned that a Javascript version of Newspeak is in the works and, as Newspeak's ancestor list includes Smallalk, has encountered the same problems and more. 
The problem is reminiscient of the problems of implementing dynamic languages on the JVM, which have recently been adressed in Java 7 with the invokedynamic bytecode and related functionality. A somewhat comparable solution for the JS platform are Dynamic Proxies, which will be included in a future version of Javascript. Early versions of Dynamic Proxy support exist in Mozilla Firefox and work on Dynamic Proxy support in Google's V8 has started too. Obviously, it will take a while until languages for Javascript VMs can rely on Dynamic Proxies being available; whether it'll take as long as Java's invokedynamic functionality remains to be seen.

Finally, another approach to bringing a Smalltalk-style IDEs to the web browser is the Lively Kernel. Created a while ago by a team around Dan Ingalls, it was moved from Oracle into its own project. The project's been silent for a while, but a recent announcement shows that Lively Kernel 2.0 has been progressing. Dan Ingalls has explained the reasons the ideas and concepts behind the original Lively Kernel, and the Lively Kernel 2.0 brings a new rendering mode for the Morphic based GUI, a new way to serialize the state of a Lively session, similar to Smallalk Images.

Rate this Article

Adoption
Style

BT