Saturday, March 18, 2006

JSR292

There is a very interesting development in the Java language which is to put in support for dynamicly typed languages and hotswapping, the runtime addition and subtraction of fields and methods like Object Rexx, Objective C, Ruby and some other languages can do. Gilad Bracha, who blogged about it, doubts whether there can be full hotswapping support for a mandatory typechecked language like Java, but even if that is not feasible, it should be in for the dynamic language support.

My take on this is that is mostly better to have strongly typed constructs, but for speed, shortcuts and prototyping I am sometimes tempted into using those luxurious and rather untyped Rexx strings. Sometimes they stay, and at other times I opt for replacing them with (types) classes, mostly because I find it easier to keep a good oversight when things are called what they are. Rexx strings are their own unique type, because they allow you to do (multiprecision) arithmetic on strings, which is sometimes very welcome, mostly when doing things with strings. As we move to metaprogramming, by which I mean the runtime manipulation of types and classes and simultaneous use of those, we need to go more dynamic as we might be hampered by an extra compile cycle. Of course most cases where dynamic typing seems to be necessary can be solved by generating source and calling the compiler one more time.

No comments: