Saturday, November 04, 2006

Vista Smalltalk

Last week I attended the Ottawa Smalltalk Users Group to hear a talk by Peter Fisk, on his Vista Smalltalk. Peter blogs regularly and eloquently about his development efforts here. It's a must read if you're interested in Smalltalk or Microsoft Vista programming and want to experience more programming joy.

I intended to blog about it but David Buck beat me to it and created a nice screen demo of the Vista Smalltalk system. If you are a Smalltalker, you have to see this, go to Davids screen capture now!.

The evening was lots of fun. Peter is a veteran of the computing industry and started off with a history review of his computing background. The summary was entertaining and unfortunately for me, a reminder that I had lived through some of the ancient history myself. Yeah, we're old dudes who know Smalltalk...

As a VM implementor, I was keen to understand the details so if that kind of thing thrills you, read on.

Peter has basically written an interpreter for Smalltalk in C#. He supports the usual stuff (blocks) but not the esoteric (become:). Vista Smalltalk parses Smalltalk from text, every time (there is no image) and creates its own internal runtime format (classes, methods). You'd think it takes time, but by keeping the class libraries small (clearly Peter is a fan of "small is beautiful", it does ok). Peter also showed some configuration files which describe what to download into your web browser. This allows you to download just what you need for your application. You can decide to include a development environment (see Dave's screen cast for a demo). A development image has a workspace and supports a class browser. You can modify code, run doits, and normal development environment stuff, all running inside your web browser, all written in Smalltalk.

For his class library, he has a core subset of the Smalltalk libraries. Interestingly, he also has these "mapped" classes which are are directly mapped to native format CLR classes (I believe String is done this way). Looks like it makes it pretty simple to add natives and reuse CLR classes. There was some discussion if all the CLR methods for a particular mapped class are available by default, but currently you have to decide what to expose to the Smalltalk libraries via a primitive syntax. Peter said it would be pretty easy to do some reflection munging around to make these methods available for "free" but the current mechanism is good enough.

Since he has his own interpreter, he is not using the MSIL "bytecodes" directly. Peter says it's possible to do so but he decided not to compile to MSIL or create assemblies (assemblies are fancy .net DLLs) for a few reasons. First, assemblies have problems with unloading and he needs hot code replace (classes and methods) to work. .NET contains a newer solution with the introduction of a facility called "lightweight code generation" and while Peter said he could probably use that, he also said that the facility needed special signed permissions to be allowed to run in browsers and he wanted to avoid the signing issue for now. Peter's focus is on writing code that can run in browsers with no headaches.

Peter's target is browser execution, and a simplified application programming for Microsoft Vista which includes new technologies like XAML. Since his focus is on the client side, with tight browser (desktop support too), the key is integration with .NET. I think he spends alot of his time, just figuring out how CLR / .NET / WinForms/ WPF and threading all works. It was clear he gets much joy in doing things the Microsoft manual says you can't or shouldn't and specifically is proud about how easy it is to create apps with his system. Leveraging the .NET clases makes for some compelling demos too.

Peter wants to get stuff done. He sees Smalltalk as the best way to get there, so he wrote his own Smalltalk interpreter (where have I heard that before ?). I thought it was pretty cool, he is trying to solve a specific problem and is just going to build what he needs to solve it. Refreshing...

After the talk, we retired to the pub, swapping old and new tales. Any inaccuracies in the above description can be attributed to beer and the late night. I am fully prepared to go back and drink more beer with Peter or anyone else who attended to correct any details I got wrong.

The Vista Smalltalk demo and talk was fun to see, and it's going to be neat to watch it evolve. Go Peter go !

3 Comments:

Blogger Slava Pestov said...

I wanted to go to this presentation, but unfortunately couldn't make it this time. I wish the Ottawa ST user group would meet more often.

7:00 PM  
Blogger pfisk said...

John,

Thank you for your comments.
It was good talking to you.

12:30 PM  
Blogger heho said...

On a similar note, you may find the following amusing: At my otherwise shamefully outdated and rather uninteresting site, check out

http://www.helgehorch.de/esug/index.html

It's a restauration of and homage to Smalltalk-76. You may have heard of it, it's the stuff that Dan briefly showed at ESUG '04, and the ultimate ancestor of his JSqueak project.

It too is a "classic" compiler and bytecode interpreter, nothing fancy JVM-wise. And no #become: either, but ST76 didn't have that anyway.

While Dan once remarked that speedwise it had broken the "scripting barrier", its performance is nothing to write home about. Compared using Squeak's Eratosthenes-Fibonacci microbenchmark:

ST-76: 4.0M bytecodes/s, 240k sends/s
Squeak 3.8: 82M bytecodes/s, 4.1M sends/s

But it's still fun, both for historical preservation and for the occasional semi-transparent dragon curve in a browser. ;-)

Enjoy,
Helge

12:10 PM  

Post a Comment

<< Home