Jim Besemer

One of my first experiences with object-oriented programming projects in Smalltalk was at TekLabs. I was assigned to extend the grammar of the language for an experimental concurrent programming environment.

The grammar was parsed by another language generation tool, also written in Smalltalk. It was cool in that you could change the grammar in one window and look at now-modified parse trees, etc., in others.

Unfortunately, it was uncool in that it was exponentially slow on the size of the grammar (or probably worse). Someone had typed in Algorithm 6.6 from Aho & Ullman's "GreenDragon" book more or less unmodified. On the one hand, it was cool that their Smalltalk implementation was not much larger than the published version. And it was cool that it worked at all. After all, Smalltalk had sets so it was easy to whip up a canonical set of items class. I'm sure development time was mere days or possibly even hours.

But when I started, it took about 45 minutes to regenerate the LALR(1) table for each prospective change. After adding a half-dozen productions to the language, it was taking over an hour to regenerate. Worse, extreme care had to be exercised in interacting with the tool, since inadvertently clicking on the wrong window caused the whole thing to go into regenerate mode and the system was essentially locked up for the next hour.

Finally, one day in frustration, I gave up. I skipped lunch, exported the grammar to a file and wrote an Awk script to convert the grammar to Yacc form. Yacc could parse the grammar and diagnose any problems in under 1 second, more than a 3600:1 improvement. I finally could focus on the task at hand, without hours intervening between prospective change and error message. After days of hardly any progress, I finished extending and debugging the grammar and imported it back to the Smalltalk system later that afternoon.

In the status meeting the following week, I announced that I had been using Yacc, Awk and Unix to do some "exploratory", "rapid prototyping" for Smalltalk. Everybody found this very funny. Nobody actually asked how much faster it was. They just assumed I couldn't master their cool tool. There was much about Smalltalk that was innovative and cool. This misled them all into believing that it could do no wrong and that no prior art could possibly be anywhere near as good.

That was many years ago, 1987 or 88 or so.

-- JimBesemer


CategoryHomePage

EditText of this page (last edited July 15, 2003) or FindPage with title or text search