Friday, September 01, 2006

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.

2 comments:

Erik Corry said...

I tried to play a little with this. I can report that things work much better if you use Eclipse 3.2.1 rather than 3.1.something.

It seems that / is not recognized as an operator (or binary message send, as the ST afficionados would have it). So I thought I'd add it, but I can't find the lexer. Are you using some sort of default lexer from Hadrian, or am I just looking in the wrong place?

plesner said...

The lexer's there but due to the ass-kickingness of Hadrian it's only around 30 lines of code.

The operators are defined in saturn.ht, at the top.