Wednesday, February 25, 2009

jSuneido Progress

I pretty much have the parsing port finished. I think of Suneido as a "small" language, but it's big enough when you're trying to parse it! I have over 90% test coverage (as reported by EclEmma). The only parts that aren't well tested are the error handling. I should probably add a few more tests for that.

The tests are more "functional" than "unit" tests. If something broke they wouldn't be much help locating the exact source of the problem. But I think it would be hard to write true unit tests for something like a recursive descent parser. I'm happy enough with the functional tests.

There are probably a few things I've missed, especially to do with optional semicolons. Next I plan to try parsing all our Suneido source code. That should flush out any remaining issues.

I also want to go back and rewrite the query parsing so I can eliminate the remaining dependencies on Antlr. This shouldn't be too hard. The lexical scanning is the same as the language, just with a different set of keywords, so I don't have to write that.

Then I'll be on to the fun challenge of actually generating Java byte code.

In the long run I'd prefer not to support two implementations of Suneido. Assuming jSuneido works out for the server, I'd like to move on to figuring out how to implement the client side. The hard part here is the UI. Currently, Suneido's UI calls the Win32 API directly.

One short term solution might be to look at whether Java can call the Win32 API. If so, this would allow a quick port, although it would limit the client to Windows.

Another obvious, but longer term, approach would be to rewrite the UI in Swing or SWT.

A less obvious, but interesting approach would be to go with a browser type approach using HTML, CSS, Javascript. This is a really messy, ugly approach, but it has some interesting properties. For example, it's the approach being taken by the new Palm webOS.

In any case, this is all speculation. I've still got plenty to do to get the server part of jSuneido working.


Jason said...

Thats great news. From a UI point of view Swing has made a number of performance improvements over the years. And works where Java works that can't be overlooked.

SWT is great (and fast) but it always seems to be one step behind swing on other platforms other than windows (Like the mac).

I like the idea of HTML AJAX for the front end but the thing that draws me to (j)Suneido is that everythings in one place in the platform.

Maybe after the server has been ported. Making java API code callable from jSuneido would be a great first step toward UI.

andrew said...

You might be able to take the AJAX approach but still stay all-in-one if you bundled a browser engine like webkit or gecko. On Windows you can use IE because it's always there, but that isn't portable.

For example, I suspect the iTunes application includes webkit.

Bundling the browser engine also means you don't have to worry about browser incompatibilities.

Of course, bundling it in would increase the size of Suneido :-(