Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Web Development

JRuby: Making the Enterprise See Red


Charles Nutter and Thomas Enebo are on the verge of releasing JRuby version 1.0. The pair are the principal developers of the pure Java-based Ruby interpreter, and they took some time out from the final bug fixes to hold a tutorial at RailsConf in Portland, Oregon: "Your First Day with JRuby on Rails." However, their talk was not focused solely on getting started with JRuby. They also reported on the convergence of a lot complementary technologies from Sun that are supporting Ruby, including NetBeans and Glassfish.

Before diving into the "How To" of JRuby, Charles and Thomas addressed the "Why." As in, why would Ruby developers opt for JRuby over the C-based version that already works for them? First, JRuby provides a foot in the door, getting Ruby into Java-centric organizations that otherwise might balk at a new language or platform. Equally important however, JRuby may convince Ruby developers to adopt the Java platform to take advantage of its scalability and to get at the wealth of Java libraries that provide capabilities that Ruby currently lacks.

They also wanted to assure the audience that one could gain the advantages of the Java platform without deviating from the Ruby Way. JRuby is not an attempt to fork Ruby or future versions won't corrupt it with "improvements." To that end, JRuby 0.9.9 is almost identical to Ruby 1.8.5, and the JRuby install includes all of the same standard libraries that ship with Ruby. Charles pointed out, " We've bent over backwards to make sure that JRuby is as compatible as possible." With the addition of just a few import statements, most pure Ruby gems run fine in JRuby. After demonstrating a standard Rails installation operating as expected, Thomas exclaimed, "Isn't it exciting how boring it is?"

Speed is another potential barrier to adoption, but Charles reported that the current version of JRuby is about on par with Ruby. Previously, JRuby has been purely interpreted code. Over the past few months the team has focused on improving the compiler's ability to handle Ruby syntax. Right now, about 25% of the code in a typical Ruby app can compile. In JRuby 1.0, the compiler runs in a JIT mode, so as running code reaches a certain number of invocations, it will get compiled, after which point the compiled version runs. The goal after the 1.0 release is to continue increasing the amount of JIT compiled code.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.