Thoughts on Perl and Emacs, technology and writing

A Basic Transcripter in PLT Scheme

PLT Scheme provides a graphical toolkit for implementing GUIs called MrEd. At least on Windows, the result looks like a native application and was used to implement the IDE, DrScheme. As usual, the documentation is excellent.

When an application is running, it can be useful for it to output diagnostics that report on what it is currently doing, e.g. which database it connected to, or the id of a transaction that may have failed. This is normally output to a file, but it can also copy the output to a logging window, e.g. the Transcripter in Squeak, or the Java Web Start Console. How easy is it to implement a simple transcripter in PLT Scheme?

As usual, it is a good idea to decide on your API first as encapsulating everything behind an API means that we can easily change the implementation later on. I will simply provide a function (log s) where s is a string but you would probably want to have various logging levels which can be enabled or disabled at runtime.

A couple of things. First of all, performance: When I ran this initially, the display numbers test took ~60ms. However, when I expanded the Transcripter window to a reasonable size, it took ~2000ms (2 seconds!) When I retried the same in Squeak it took around 5700ms although I’m certain it had earlier taken more than 10 seconds. This is a different computer and a different image but maybe the Squeak Transcripter isn’t so bad after all.

Secondly, it was fairly straight-forward to construct the GUI. Of course, such a simple example doesn’t really give any idea how hard it is to use MrEd to create moderately complex GUIs, but the existence of DrScheme indicates that it is at least possible.