QuickSilver Smalltalk-to-JavaScript Compiler
February 2, 2011
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.
February 2, 2011 at 1:34 pm
Hi,
Excellent work! This might just be the most promising Smalltalk implementation I’ve seen in a long time.
Thanks for your time and effort.
I tested this in every browser I could get my hands on and unfortunately there were a few errors in Safari:
vm.js:28 SyntaxError: Parse error
startup.js:3 TypeError: Result of expression ‘Smalltalk.Vm’ [undefined] is not a constructor.
quicksilver.js:3 TypeError: Result of expression ‘Smalltalk.fns.openTranscript’ [undefined] is not a function.
I know it’s not finished yet but I wanted to pass this info along :).
February 2, 2011 at 2:38 pm
Thank you Mark.
I will add the info to the bug list.
— Peter
February 2, 2011 at 2:22 pm
Howw does this compare to Avi’s Clamato?
http://clamato.net/
February 2, 2011 at 2:46 pm
Hi John,
I briefly looked at Clamato.
Both the SST interpreters and the QuickSilver compiler support the entire Squeak syntax including returns, metaclasses, and standard Smalltalk variable syntax. The only modification that I made was to add a new syntax element “{}” for inlining JavaScript code.
— Peter
February 3, 2011 at 5:20 am
Hi Peter,
very nice Smalltalk you’re building there 🙂 While there have been quite a number of Smalltalk-on-JavaScript demos, having a full environment is great.
Your point about “how many of these devices are running Smalltalk applications” is well taken, it’s a small fraction of the total. However, your guesstimate is still off by an order of magnitude: Etoys (written in Squeak) comes pre-installed on every OLPC XO laptop, and there are well over a million in use. To my knowledge this is the largest Smalltalk deployment in existence. The full Squeak environment is included (hidden, but accessible).
– Bert –
February 3, 2011 at 8:35 am
Hi Bert,
You are right. I forgot about OLPC.
Thanks
February 12, 2011 at 3:14 pm
Hi Peter,
Great work!
What is the relation between Quicksilver and Silver Smalltalk?
I saw in some older post that the code for Silver costs u$s 99.
Thanks!
February 12, 2011 at 3:19 pm
QuickSilver is a new project which consists of a hand-coded compiler in JavaScript.
SST/Silverlight, SST/JavaScript, SST/Java, and SST/ActionScript are cross-platform Smalltalk interpreters.
The $99 is the source price for all of them.
April 21, 2011 at 8:15 pm
Is there any way to get my hands on the code?
I’d be interested in helping, if it would be a substantial step toward running Scratch in the browser.
April 22, 2011 at 10:09 pm
Hi Jason,
The compiler code is here:
http://code.google.com/p/quicksilver-smalltalk/
— Peter
April 28, 2011 at 10:57 am
Dear Peter,
after quit a while without any news on Quicksilver/Silversmalltalk, I’d like to ask whether development is still ongoing?
Regards, Steffen
May 5, 2011 at 8:21 am
Hi Steffen,
Development of the libraries has been on hold pending the release of a stable version of ExtJs 4.0; there are still some issues with some parts of the Ext SDK.
I will be moving this blog from WordPress to a forum on my own site probably in early June.
The focus will be on tools for rapidly creating client interfaces for web applications.
— Peter
May 1, 2011 at 3:36 pm
Hi Peter,
I was wondering the same as Steffen (above me).
Was following the development of Silversmalltalk with great interest. I still think your vision is on the spot and has great potential.
Regards,
Sebastian
June 20, 2011 at 1:59 pm
Hello Peter,
I would like to contact you via email to see if we can co-operate in EXT JS / Secha run by Smalltalk. Would you please respond to my email address.
Thank you very much
Gerd
July 25, 2011 at 11:56 pm
Hello Peter,
Can you please provide an update to the development of SilverSmalltalk? Thank you.
PeterO