JRuby - An Introduction

Visionary: Charles Nutter

Interviewed by: Robert Dempsey on 05/23/2007 by Email

Summary

JRuby is a Ruby language interpreter written in Java, providing integration between the two, and allowing access to each from the other. In this interview with Charles Nutter, one of the JRuby team members, Robert Dempsey finds out the impact JRuby will have on Rails developers, and the enterprise adoption of Ruby.

Interview

What is JRuby?

JRuby is a pure Java implementation of the Ruby language. We’ve tried to make it as compatible as possible while also working to improve performance…basically, to make it the best Ruby implementation we’re able. Currently we’re finishing up our 1.0 release, which is very nearly 100% compatible with Ruby 1.8.5 and can run Rails and other popular Ruby applications with great performance. jruby.org

What is Glassfish, and how does it compare to other Java application servers?

GlassFish is an application server developed by Sun Microsystems. It’s fully open-source and available for all to use and deploy. What sets GlassFish apart for me is their focus on both performance and footprint; GlassFish is perhaps the smallest full-stack EE server, and it can scale up and down to a vast range of applications. It’s really an outstanding piece of work. glassfish.dev.java.net

How do I use JRuby in my development activities? Do I use it to write apps or only to package my Rails apps as a .war file for deployment?

You can use JRuby for day-to-day development as well. We’ve tried to make JRuby a “drop-in replacement” for the C implementation, so all the typical command-line tools work just the same. And most of the typical server scenarios work in addition to WAR deployment, such as development-time execution on WEBrick or Mongrel. You should be able to use JRuby just like you use Ruby today.

Once my application is packaged up as a .war file, can I only deploy to Glassfish or can I deploy to other app servers?

The WAR file created by GoldSpike (a JRuby-Extras project for making Rails WAR files) is deployable on any standard servlet container. We prefer GlassFish because of its ease-of-use, performance, and small memory and disk footprint.

As a Rails developer, what are the benefits of my learning JRuby, and is there a sharp learning curve?

JRuby is just Ruby! The learning curve for a Ruby or Rails developer to get up and going on JRuby is very minimal. Just swap out the command you use to run things (“jruby” instead of “ruby”) and you’re up and running. If you are interested in taking advantage of Java features, there’s a world of documentation out there for the thousands of libraries and frameworks the platform has to offer. Once you’re comfortable running Ruby code on JRuby, you can start taking advantage of everything else.

I have heard that applications can see up to a 4x increase in performance using JRuby. What have you all heard or seen?

We have heard anecdotal evidence stating that JRuby on Rails performs extremely well, but we will reserve judgment until there’s some hard performance numbers available. We continue to improve performance while rounding out compatibility, and things can only get faster from here. If we’re not faster now…we will be soon.

Do you see JRuby helping Ruby on Rails to dig deeper into the enterprise space?

Absolutely. Most large Java-based organizations are not willing to throw out that infrastructure for the new kid on the block…nor should they be. Java the platform scales extremely well, deploys like a breeze, and comes with extensive management and monitoring capabilities out of the box. JRuby on Rails allows those organizations to stay on their current platforms, current servers, current expertise while expanding web development to Rails (simultaneously making their web developers a whole lot happier). I can’t emphasize this fact enough: I believe JRuby is Ruby’s path into the enterprise. And I also believe we can get there without sacrificing what’s made Ruby and Rails great. We will have our cake and eat it too.

Are there any important points that I did not ask that you feel should be mentioned?

JRuby is a community project. We lead developers play traffic-cops as much as developers, routing patches, cultivating contributors, and leading design discussions. We’re always looking for new contributors to join the project and help out, and we’ve tried to simplify the codebase so anyone can get involved. Stop by jruby.org, join the mailing lists, browse the wiki and the code. You’ll be glad you did.

License:

Go back to the list