#Smalltalk for .NET - Don Roberts and John Brant
This is a 9 month effort so far (from OOPSLA last year). "Our use of S# would have been better since we really are Smalltalk". Ouch :)
Completely new Smalltalk on top of the CLR. Hey, I can download it from a #Smalltalk based web server here.... It's ANSI compliant. Seamless access to the .NET framework. Open Source, Free as in Beer. .NET classes look like Smalltalk classes. .NET messages are transliterated into same name with keyword syntax. Constructors are done with #new or #new:
x := Regex new. x := Regex new: '[[Ff]oo'. matches := x Matches: 'hello foo' starting: 5.
Yes, the cap method name is because it's calling a .NET method in a .NET class.
- Modifying classes at runtime
- Changing the class of objects at runtime
Collections All Smalltalk collections are implemented - they are mostly wrappers on top of the .NET framework, in addition to a full set of Smalltalk collections. Performance - about on par with Dolphin speed. VW and VA are typically faster.
- Based on MS technology
- Good for scripting windows
- Easy for smalltalkers to use .NET
- Relatively small, standalone exes
- Available now
- Free, as in beer
- Complete source available
- Based on MS technology
- Edit/compile/run (repeat) cycle
- No IDE - yet (use EMACS)
- Very few optimizations
Demo time - they've got Store working for this, and GLORP ported. Hey cool - he's got a demo of a radar weather view. There's a bunch of stuff that comes "free" with the .NET framework. They develop in VW and then export as SIF. The code behind this is pretty simple looking.
open | thread | files := OrderedCollection new. form := Form new. form Width: 650 Height: 680. form Text: 'Don''s Radar'. scrollbar := HScrollBar new. scrollbar Minimum: 0 Maximum: 100 Value: 10. form Controls Add: scrollbar. picture := PictureBox new. ....
And so on. Other than the naming convention for methods, it looks fairly normal. To run this, install .NET 1.1. About a 100 MB download for runtime, dev, and doc. Integrated with the MS debugger, so you can do things the MS debugger can do - such as attach it to a running Windows process (like the #Smalltalk interpreter). Not as transparent as a Smalltalk debugger, but ok in this world. Primitives to the .NET framework are implemented via compiler calls using blocks. For some of the common Smalltalk optimizations (#ifTrue:, etc) - they have macros built on the rb parser instead of the kinds of compiler hints most Smalltalks use). Allows for 'on the fly, extensible' optimizations. This rewriting is part of the compiling, so the developer's source stays as they expect.
To ship an app - ship the exe, the LargeInteger dll, and ensure that the .NET runtime is down.
Questions Have you looked at Eclipse, thought about that - Don: "We thought about it, when we looked at it I wasn't that impressed". No image, right? - Correct Compiling to the CLR bytecodes? - Yes What about the VisualStudio? We don't own it Why do we need the LargeInteger DLL? - because we wrote it in C# instead of paying for the #Smalltalk overhead. Does it run under Mono? - We have had it running there, but it breaks frequently. Almost runs under Mono.