Tuesday, September 02, 2008

Google Chrome, JavaScript and Smalltalk

The secret is out since yesterday: Google has released Google Chrome - a new webbrowser. It's easy to install - and from a first impression also very fast. But that's not the exciting news - at least not for us Smalltalkers.

The most interesting part is a new implementation for the JavaScript Engine called "V8" done by members of the orginal Animorphic team. Animorphic Smalltalk was a Smalltalk system built around the mid-90s as part of a startup that was informally known as Animorphic Systems. In early 1997, Animorphic was acquired by Sun, and much of the underlying VM technology was put to real use in the Java Hotspot VM.

Animorphic Smalltalk included a high performance VM, a blue-book compatible library, novel browsers and flyweight glyph-based GUI framework, optional type system, mirror based reflection and mixins. It was later released into Open Source.

Lars Bak is now responsible for V8 at Google (he was technical lead for Strongtalk Smalltalk VM and the Java HotSpot VM. I already posted about his early work on OOVM and expected something like this - especially after I havent heard anything from him since 2004 after Esmertec acquired OOVM.

Another interesting aspect of the V8 virtual machine is that it's open source. Just use

svn checkout http://v8.googlecode.com/svn/trunk/ v8-read-only"

to checkout the project (13,6 MB). It is mainly written in C++, based on the Strongtalk Smalltalk code and released with a BSD/MIT license. It uses some neat design tricks like dynamically created hidden classes (as you can read on the Design doc page)

Dave Griswold has posted some more information on the Strongtalk list and on the Squeak list.

While Daren is trying to run first benchmarks I gave Dan's lively kernel a try. Lively Kernel is desktop kernel written in JavaScript by Dan Ingalls (of Smalltalk fame) while working at Sun. Right jump into the kernel page with the chrome browser. It's really fast compared to JavaScript engines I tried before.

So JavaScript is hotting up and more interesting work is in the pipe. Maybe you remember Ian's work on open extensible object systems at Viewpoint research institute. With just 400 lines of code and no serious attempt on optimization he was able to implement a JavaScript version that was faster than WebKit/Safari and Firefox...

Regarding performance and running Smalltalk David Griswold explains:
"I'm sure that these sorts of things can be worked around, but they do mean
that V8 will never in its pure form quite reach the pinnacle of theoretical
performance possible for a VM targeted specifically to Smalltalk etc. So it
won't be as fast as Strongtalk, although it may get fairly close to
VisualWorks performance.
"

"Remember it will still be a lot easier to run other dynamic languages on JavaScript than it is to run them on Java, since at least JavaScript is fully dynamic, unlike
Java.
"

"The release of the V8 VM is the beginning of a whole new era for
dynamic languages (Smalltalk, Ruby, Python, etc).

Let the flood of fast new dynamic language implementations begin!
"

I'm eager what the answer of Microsoft will be (especially since my friend David Simmons (Smallscript/S#) is working on scripting languages there) and if .NET and Suns JVM will be more friendly to dynamic languages in the future. Interesting times ...

1 comment:

The Manager said...

Hello,

Nice post, by the way if you want to have more information about Google Chrome Easter Eggs, Secrets and the funny Google Chrome Crasher.... just check this post >> http://hostintruder.wordpress.com/2008/09/03/google-chrome-superpower-browser/

You will have a detail description of Google Chrome.
Bye.