BottomFeeder

Upgraders Beware

February 22, 2005 1:54:38.352

The latest upgrades for BottomFeeder on the dev stream, appear to render BottomFeeder unstartable, at least under MacOSX. Of the two parcels upgraded, the offender seems to be the WSBundle.pcl. By removing that .pcl in the app directory, it is willing to startup. One thing that's unclear to me is... when you remove one of BottomFeeders "upgrade" parcels, what does it revert to? The original downloaded version? Or the last known good download?

AmbraiSmalltalk

First Impressions

February 22, 2005 2:27:38.430

I downloaded and played with Ambrai Smalltalk this evening. I missed their talk the year they presented in Toronto and wasn't really aware that they were still charging on. I was mistaken.

I followed their demo. A beginner might be a bit puzzled as to what he was supposed to do with the downloaded .st file or how to evaluate code, but it was otherwise pretty straightforward. A basic demonstration of "look we made a difference amongst your other pretty windows."

That didn't take long, so I wandered around the system some. The browser's navigability is pretty primitive, if you're coming from a power tool like VisualWorks, it can feel a little cumbersome. But it's a second beta, so it's pretty impressive. I'd suspect some strong VSE/Dolphin influence or at least similarities. Smalltalks with tight OS integration seem to have a similar feel. Browsing around, I noticed that it seems to be pretty well flushed. But economically spartan at the same time.

Classical <primitive #####> 's are used for the normal Smalltalk primitives (i.e. adding numbers, at:put, etc). But for things like the OS interface (file streams for example), it's written in something more like DLLCC. This I like. I wish more of VisualWorks was implemented in transparent Smalltalk-to-native-library objects, rather than wondering just what the primitive that does a directoryContents really does.

There are no Processes, instead there are Tasks. It would be interesting to learn just what these can do. The number hierarchy is light; it uses double dispatching right off the bat (doesn't even bother to fail the primitive first). IndexedCollection didn't understand at:ifAbsent:, but that was readily fixed, and it worked fine. Even better, getting Symbol to understand value: so that #(1 2 3 4 5 6 7 8) collect: #odd works fine was a snap. Growsing around, it seems that it is not the case that a bunch of behavior is hidden behind the scenes (such as the parser/compiler). The debugger is functional enough. It's all there in Smalltalk as it should be.

Just one more thing. One thing I'm pretty fanatical about is code formatting. It's not that I have a style I care about, it's that I'm lazy. I just want to type code and then hit the format button and have it clean it all up for me. I like the uniformity. Whether to terminate or separate with periods is academic past that. So I thought I'd see how hard it would be to add a formatter in. It took about 15 minutes wall time. Which is pretty impressive, considering I'm a stranger in a strange land here. The first mod was to add a line like:

addCommandItem: #onFormat text: 'Format' shortcut: 'Command F';
to the BrowserWindow's editMenu method. When I saw this method, I felt very much like I was back in WBPro again. It's a style I'm only beginerishly familiar with. Anway, restarting the browser, my menu item was there. After that, I added the onFormat method to the same class and begin putting braver and braver Transcript show: methods to. I was lucky to discover that there was already SmalltalkColorPrinter, which is a ParseNodeVisitor... you know the pattern. Even luckier after considering copying this to make a Formatter, to see that there was a SmalltalkPrettyPrinter class already. I just needed a convenience method to work off a string and then my onFormat method could be written as:
self textPane text: (SmalltalkColorPrinter printMethodSource: (SmalltalkPrettyPrinter printMethodSource: self textPane text))
And then of course, I promptly tested in on itself. And it worked. Pretty nifty. It doesn't preserve comments, and it needs to be smart enough to do the right thing when a class is selected, but it was cinche. I'd gamble those two items would be less than another 30 minutes yet.

AmbraiSmalltalk

The Return of the Arrow

February 23, 2005 2:21:06.422

Tonite, I played some more with Ambrai Smalltalk. More coolness. Some more observations as I growsed around the system, and then again, something fun.

  • Fonts - To render a string with in color, or bold, or italic or a specific font, 3 classes get involved from the programmer's perspective: Text, TextStyle, and Font. That's it. Pretty tactile and straightforward. Ever since rewriting ExtraEmphases, I've been looking for good examples of simple and approachable string rendering APIs. This one is a good one.
  • Contexts - That I know of, there are two Smalltalk's that can model contexts in a reflective enough fashion to do what SeaSide does. So I'm interested to see if Ambrai will have what it takes. I don't know yet. It does have an ExecutionContext which you can chain through, ask for the selector or method or reciever, look at it's arguments. It's accessed not via 'thisContext' but via ObjectMachine current currentExecutionContext. I don't just how reifable they are, whether you can copy them, restart them, etc. This is an area many "simple" Smalltalk's definitely skimp on, the amount apparently there is impressive.
  • Platforms - This is an OSX tuned platform, right? So what are those methods in ObjectMachine 'testing-processor' and 'testing-operating system' for? isPalmOS? And the method comment for applicationHandle? Maybe it's just a long heritage's accumulation over the years. Maybe there's more there.
  • Encoders - It's just the various UTF schemes!! How refreshing. And, external streams are basically binary with an encoder around them. As it should be.

Warning: Past this point there be "weird characters", browsers may not render correctly

My first Smalltalk book was the Blue Book. I was totally mystified by the syntax. It was mysterious and alluring:

foo
	↑foo

What was that about? The same word separated by a symbol I couldn't even type and it was supposed to mean something basic. It seemed so transcendental. I truly did feel as I stood on the island watching an etheral balloon floating away's up there. Ever since I figured it out though, I've always wanted to return to that transcendental plane. I want to code with the left and up arrows. I want to look at my code and think "that's so other worldly".

How hard was it to make Ambrai do this? Not hard at all. Ambrai being a small/new project, it hasn't accumulated years of Scanner hacks and attempts and renditions. There's just one, and it's pretty clean. I modified two methods (scanReturn and scanToken) and added a third (scanLeftArrowAssignment). isAssign was added to Character. And Character's isReturn was modified as well. I had to fire up the OSX Character Palette to actually input the characters (does anyone know some way to "map" these characters so I don't have to use the palette). But that's it. So I rewrote one of my favorite methods:

Symbol>>value: anObject
	↑anObject perform: self

Not much different, but that's an up arrow. To test assignment, I wrote another one of my favorite base extensions:

ReadStream>>nextUntil: aTestBlock
nextUntil: aTestBlock 
	| output |
	output ← self contentsSpecies new writeStream.
	[self atEnd or: [aTestBlock value: self peek]] whileFalse: [output nextPut: self next].
	↑output contents

The only thing left after that, was to fix my formatter from last night. I modified the SmalltalkPrettyPrinter to emit the left and up arrow and all was well again. I can now input code in either format. When I "format" it, will be transcended.

BTW: This blog means that my Upgraders Beware blog issues have been resolved. I reinstalled clean.