May. 31st, 2011

jbanana: Badly drawn banana (Default)
I have a UI generator called Compositor that builds an UI from an XML descriptor. It works fine for me, but I was thinking about what other people might want if they were to use it (and sadly, it took me quite a while to give this any serious consideration.). It occurred to me that there are several languages that run in the JVM, and that it shouldn't be to hard to have Compositor work for them too. Surely in the depths they all generate POJOs?
Groovy
This was a piece of cake. Groovy is easy if you're familiar with Java, and it didn't do anything very unexpected.
Scala
The only problem here was that Scala fields are implemented property-style: the compiler auto-generates getters and setters. That was easily fixed. Blimey, the Scala compiler is slow!
Jython
I've only got this partly working because it looks as if the Java class that's generated from a Jython class doesn't contain any of the Jython class methods. Ouch. I think I see where they're hiding, but I need to poke around some more.
Clojure
I couldn't get this one to work at all. I found documentation of how to extend a Java class, but I couldn't see how to get the examples to work. I need more Lisp knowledge.
JRuby
Haven't tried this one. Whoops.
A side effect of this work was to make me think about the OO-ish-ness of Compositor. That would allow more pluggy-inny-ness of elements for other languages. It's not clear, though, how the code would know which language context it's running in. At run time, everything is a class with some byte code in it. (Note to self: poke is System.properties to see if there's anything helpful)

August 2025

M T W T F S S
    123
45678910
11121314151617
1819202122 2324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 16th, 2025 07:49 am
Powered by Dreamwidth Studios