JRuby, Groovy, and Other Dynamic Languages On the JVM

Lately (thanks to Spring) I’ve been toying with dynamic languages a little bit running on top of java. I haven’t delved into JRuby on Rails yet, but I have been using them as scripted beans injected into java classes, largely in a way that exposes an application API to either a scripted environment, or to take advantage of their dynamic features. I have always loved Groovy, Ruby, and Javascript for two things: closures and the ability to add methods to a class at runtime. Something strikes me as great being able to to code something like:

tomorrow = 1.day.from.now;

Being able to write code that is so expressive like that is somewhat satisfactory, and I like being able to quickly prototype ideas with out the painful build process JEE development always entails. Let’s face it… JEE development is sometimes overly complex. Maybe we overcomplicate things by making or programs too abstract. Maybe we just need better “killer frameworks” to minimize the “plumbing work” (this is why I like Spring). Although the Ruby zealots will brag about what a breeze development is, imho they miss the point that the reason it’s such a breeze is because Ruby on Rails takes away all the boring work. Recently I almost felt like JEE is getting close while doing a Stuts 2 + Spring 2 + JPA + AJAX tutorial. Maybe we need Spring on Rails.

I don’t know… maybe I’m rambling, maybe Dave Thomas, Bob Martin and all are right saying “Java is the new COBOL.” Maybe JEE just needs to adapt to keep up with high paced development.

One thing is for sure… each time I use scripted beans with JRuby and Groovy to quickly prototype ideas I can’t help but think to myself, “Why not just write applications like that?” ;)