Monthly Archives: September 2006

Character pairs

Finally! My mac is back. I haven’t made much progress with saturn since my last post but in the meantime I’ve been working on something else: a contribution to eclipse.

When you create a text editor in eclipse, you can specify a character pair matcher that is typically used for highlighting matching parentheses and brackets.

In many cases when eclipse defines an interface, it also provides a default implementation that you can customize and use in your own plugin without having to deal with the full complexity of implementing the interface from scratch. In the case of ICharacterPairMatcher, however, there is no such default implementation. A few months ago I filed a feature request in the eclipse bug system for such a default implementation that you could give a set of which charaters to match, for instance "()", "[]" and "{}" and then this implementation would do all the work.

…yada yada yada, my implementation of such a character pair matcher, DefaultCharacterPairMatcher, is now a part of eclipse, as well as a new implementation of the matcher used in the Java editor. So, barring some unforeseen incident, from the next release of eclipse, my code will spring into action whenever you type a parenthesis, brace or bracket in the Java editor or any other editors that use the default character pair matcher. I think that’s pretty cool.

Saturn UI

Sigh. My mac is still being repaired. Fortunately, it turns out that my access code still works at the university so even though it’s not exactly ideal, it gives me a place to work when I really want to. So I have made some progress over the last few weeks.

Threading now works (see) but the scheduler is exceedingly stupid. One nice thing about this implementation, though, is that threading is completely deterministic. Interrupts appear to be nondeterministic but are actually based on values returned by a random number generator. All you need to know to repeat an execution is the seed of the generator and then the run will be exactly the same. That’s been pretty useful.

I’ve also found time to work on an eclipse plugin. Now there’s a perspective with a saturn editor with syntax coloring and integrated launching:


Notice the little saturn perspective marker in the top right corner. It took me forever to draw that.

The compiler is integrated with the IDE so there’s immediate compilation when files are saved:


Finally, there’s a simple debugger:


There’s still a lot of work left to do before the IDE is decent but I think it’s already surprisingly useful. You get a lot of functionality with relatively little work if you ask eclipse nicely.

By the way, if you look closely at the code in the screenshots you’ll notice that I’ve changed the block syntax from fun (...) -> ... to fn (...) -> .... I don’t really care if it’s fun or fn but I remember caring once, a few years ago when I first saw ML and O’Caml, and I remember preferring fn. I thought my former self should have some influence on this language. Even though he probably wouldn’t have liked it; he thought object orientation was for wimps. Good thing I’m running things now and not him.