Brett Hoerner's blog
A sudden interest in Java (the platform)
written on Sunday, November 23, 2008
I'll admit that I didn't have much interest in Java until Sun opened it up (thus creating the OpenJDK). Like many Python developers I've been pretty "spoiled", and reading Java code has generally left a bad taste in my mouth. In short: it's way too verbose for me, and I definitely prefer dynamic to static. I'm not saying I think anything less of Java developers, Java libraries, or Java programs - I just personally would prefer to use another language.
Java (the platform) has a lot of goodies, though. Instead of dreaming up a new language and writing your own rinky-dink VM, if you choose to target the JVM you start out with one of the largest (the largest?) sets of libraries available (assuming you make it easy to call Java from your language). You also get one of the world's best virtual machines, and thus you share a whole eco-system of tools like debuggers (I hear JSwat is great), DTrace, and more.
As of today you can already run a bunch of well known languages on the JVM - Jython (Python), JRuby (Ruby), Rhino) (JavaScript), Kahlua (Lua) in addition to "new" JVM-targeted languages like Clojure (a Lisp), Groovy (similar to Ruby) and Scala (a better Java).
It looks like there will be a lot of new features in Java 7, some of which were specifically added to support more / better / faster languages (other than Java) on the JVM. The most important one (for dynamic languages) is JSR 292 - support for a new bytecode called invokedynamic which, in short, seems to allow languages implementations to stop pretending like they have static type information when they really don't. From my loose understanding that means part of the implementation should be easier to write and the code should run faster.
Wouldn't it be cool to write an app in Jython but be able to call directly into a JRuby library that did what you needed in the best way? Or for all of the different parts in your larger app to be able to use the same DB interface or memcached library, so you don't have to worry about differences between the one you use for Python and the one you use for Ruby? At that point it seems like you really can use the best tool for the job, without a huge context switch of learning tons of new libraries, debug techniques, etc.
I know I'll be keeping my eye on all of this. For now I'm playing around with Clojure and from there I'll probably see what Django is like on Jython - seeing as that's what I'm most familiar with.