TITLE: JRubyConf, Day 1: The State of JRuby
AUTHOR: Eugene Wallingford
DATE: May 25, 2012 4:07 PM
DESC:
-----
BODY:
Immediately after
the keynote address,
the conference really began for me. As a newcomer to JRuby,
this was my first chance to hear lead developers
Charles Nutter
and
Tom Enebo
talk about the language and community. The program listed this
session as "JRuby: Full of Surprises", and Nutter opened with a
slide titled "Something About JRuby", but I just thought of the
session as a "state of the language" report.
Nutter opened with some news. First,
JRuby 1.7.0.preview1 is available.
The most important part of this for me is that Ruby 1.9.3 is
now the default language mode for the interpreter. I still
run Ruby 1.8.7 on my Macs, because I have never really needed
more and that kept my installations simple. It will be nice
to have a 1.9.3 interpreter running, too, for cases where I
want to try out some of the new goodness that 1.9 offers.
Second, JRuby has been awarded eight
Google Summer of Code
placements for 2012. This was noteworthy because there were
no Ruby projects at all in 2010 or 2011, for different reasons.
Several of the 2012 projects are worth paying attention to:
- creating a code generator for
Dalvik byte code,
which will give native support for JRuby on Android
- more work on
Ruboto,
the current way to run Ruby on Android, via Java
- implementing JRuby fibers using
Kilim fibers,
for lighterweight and faster concurrency than Java threads
can provide
- work on
krypt,
"SSL done right" for Ruby, which will eliminate the existing
dependence on OpenSSL
- filling in some of the gaps in the graphics framework
Shoes,
both Swing and SWT versions
Enebo then described several projects going on with JRuby. Some
are smaller, including closing gaps in the API for embedding Ruby
code in Java, and
Noridoc,
a tool for generating integrated Ruby documentation for Ruby and
Java APIs that work together. Clever -- "No
ri
doc".
One project is major: work on the JRuby compiler itself. This
includes improving to the intermediate representation used by
JRuby, separating more cleanly the stages of the compiler, and
writing a new, better run-time system. I didn't realize until
this talk just how much overlap there is in the existing scanner,
parser, analyzer, and code generator of JRuby. I plan to study
the JRuby compiler in some detail this summer, so this talk whet
my appetite. One of the big challenges facing the JRuby team is
to identify execution hot spots that will allow the compiler to
do a better job of caching, inlining, and optimizing byte codes.
This led naturally into Nutter's discussion of the other major
project going on:
JRuby support
for the JVM's new invokedynamic instruction. He hailed
invokedynamic as "the most important change to the JVM
-- ever". Without it, JRuby's method invocation logic is opaque
to the JVM optimizer, including caching and inlining. With it,
the JRuby compiler will be able not only to generate optimizable
function calls but also more efficient treatment of instance
variables and constants.
Nutter showed some performance data comparing JRuby to MRI Ruby
1.9.3 on some standard benchmarks. Running on Java 6, JRuby is
between 1.3 and 1.9 times faster than the C-based compiler on
the benchmark suites. When they run it on Java 7, performance
jumps to speed-ups of between 2.6 and 4.3. That kind of speed
is enough to make JRuby attractive for many compute-intensive
applications.
Just as Nutter opened with news, he closed with news. He and
Enebo are
moving to RedHat.
They will work with various RedHat and JBoss teams, including
TorqueBox,
which I'll mention in an upcoming JRubyConf post. Nutter and
Enebo have been at
EngineYard
for three years, following a three-year stint at Sun. It is
good to know that, as the corporate climate around Java and
Ruby evolves, there is usually a company willing to support
open-source JRuby development.
~~~~
IMAGE 1: my photo of Charles Nutter talking about some details
of the JRuby compiler. License:
Creative Commons Attribution-ShareAlike 3.0 Unported.
IMAGE 2: my photo of Charles Nutter and Tom Enebo announcing their
move to RedHat. License:
Creative Commons Attribution-ShareAlike 3.0 Unported.
-----