RailsConf – JRuby

The session I had been anticipating the most – JRuby on Rails by Charles Nutter.

Charles talked a little about the history of JRuby, and what’s happening now with Sun having taken an interest. While JRuby is currently slower than C Ruby, he believes they will match the performance before too long, and they are working on a compiler that could mean it exceeds C Ruby’s performance.

He showed a basic example of a simple Ruby script that could load in and use Java classes. There are some nice features, like JavaBeans style getProperty and setProperty methods getting translated into property and property= accessors on the Ruby side.

A bit of a comparison of the state of Java web development with Rails – Java is everywhere and has an exhaustive range of libraries, including some things that haven’t been implented in any other language. On the other hand, Java web developers are unhappy because there are some many different frameworks and tools they have to learn. In comparison Rails developers are happy.

Bringing Rails to the Java world brings benefits to Rails – it gets access to all those Java libraries, pretty much any database through JDBC, and ‘Enterprise’ tools like clustering and monitoring. In return, Java gains a usable and productive web development tool, useful schema management through Migrations, and the ease of markup.

To show this off, Charles then gave a demo of the ‘Depot’ application from ‘Agile Web Development with Rails’, running in JRuby against a JDBC database. That was impressive. It got even more impressive when he showed an extra function talking to an EJB as backend, and another talking to a JMX MBean! (This struck a chord as I have worked on some JMX monitoring tools for our application here).

There are of course some areas of Rails on JRuby that need some work still, for example improvements to Active Record/JDBC integration, getting Mongrel working, and GUI tool support. However this presentation showed a promising future.

I hope to be trying to get my test server at work up and running in JRuby soon – it will help it integrate with the rest of our environment, and might be useful for deploying to our test servers.

Post a Comment

Your email is never published nor shared. Required fields are marked *