http://www.silversmalltalk.com/index3.html

Above is an image of the current QuickSilver test environment.

QuickSilver is a Smalltalk-to-JavaScript compiler which is written entirely (hand-coded) in JavaScript. It should be complete in a few more days and I estimate that the compressed final version will be about 20kb in size.

Smalltalk applications compiled with QuickSilver run at the full speed of native JavaScript since it is just compiled JavaScript code that is produced – there is no interpreter present.

The language syntax is that of Squeak Smalltalk with one minor adjustment – anything between braces “{” and “}” is simply inserted unchanged into the compiled output. This lets you intersperse native JavaScript into your code; there is no need for “primitive” functions.

For example:

| x pi |

x := {[3, 4, 5, 6, ‘hello’, ‘world’]}.

pi := {Math.PI}.

QuickSilver will be released as “Public Domain” software when completed. I will be adding a code viewer and a test area to the main Silver Smalltalk page tomorrow.

A couple of days ago, I received an email from a developer whose team had also developed a Smalltalk-JavaScript compiler that they were using internally and planned to release sometime as open source. It appears that the details of our two approaches are slightly different but our conclusions are the same – it is entirely (100%) practical to run Smalltalk in a JavaScript environment.

That means that as of today (Feb 2, 2011) there are *at least three* ways to run Smalltalk in a JavaScript environment:

1) the SST.js interpreter which executes Squeak bytecodes

2) QuickSilver in a few more days

3) the other team’s approach that I mentioned above

It doesn’t really matter to me which of these becomes the most popular as long as developers start using *some* online Smalltalk environment for deploying applications in JavaScript.

The number of Internet users in the world has just pasted the 2 BILLION mark – and the number of mobile users is now estimated at over 5 BILLION.

And how many of these devices are running Smalltalk applications? Even if you include server-side VisualAge, VisualWorks, Dolphin, Squeak and everything else my guess is that the total is in the thousands – say somewhere between 5 thousand and 100 thousand.

And how many of these devices are running JavaScript? Probably most of them – say between 2 BILLION and 5 BILLION.

So getting Smalltalk to run in the JavaScript environment is not an academic exercise – it is a way of opening up huge new markets for Smalltalk application developers.

I need help developing the Smalltalk class libraries tailored to JavaScript and I will be making online accounts available free for anyone wanting to contribute.

Also, if any Smalltalk gurus want to point out why it is impossible to run Smalltalk in JavaScript please post an example and I will respond.