JavaOne has been moved to coincide with Oracle’s annual OpenWorld conference in September, so as a result, the JRuby team at Engine Yard has had a few more months to prepare for their planned release of JRuby 1.6.
Thomas Enebo, co-creator of the JRuby project, said the project has been progressing nicely. As JRuby allows Ruby applications to run on top of a JVM, it includes a few workarounds, such as those to allow JDBC to work with Ruby applications. Version 1.6 is now laying the foundations for the removal of those workarounds, thanks to hooks being placed in the OpenJDK (Java SE 7) that should allow for easier development of interpreters for other languages running on top of the JVM.
“The OpenJDK is going to have support for invoking dynamic dispatch at a byte-code level,” said Enebo. “It should be faster, but it’s only just now at the phase where they’ve solidified the things they need to support it. Even if it was only moderately faster, it’s a great thing for other languages on the JVM.”
That will allow for cleaner dependency injections and more flexibility for the platform to allow developers to do exactly what they want with their Ruby code, he added.
“We can already do all the things ‘invoke dynamic’ allows in our codebase today, but it means we have to generate lots of Java classes to accomplish the same thing,” said Enebo. “We end up loading lots of classes, which slows down load time and eats up method inlining budgets. Invoke dynamic is not supposed to be a part of the inline budget, so in theory, things could end up being dramatically faster. So far, however, they’ve just been a little faster.”
Preparing to use the OpenJDK is just one part of a larger optimization plan that begins in version 1.6. Enebo said the team has recently begun working on a new internal representation of JRuby, a lengthy process that will allow for significant performance improvement and optimization down the line.
“Up to this point, we’ve generated a big abstract syntax tree that our JIT [just in time] compiler walks,” he said. “It’s difficult to do some of the levels of optimization we want to do. We’ve now got someone who got their Ph.D. on writing and optimizing a Java compiler optimizing our Ruby compiler. This will allow crazy stuff, like method inlining, block inlining, dead variable elimination and loop unrolling. But for 1.6, we hope to basically have a simple experimental interpreter in place.”
The JRuby team hopes to have version 1.6 ready for final release by the Sept. 19 start date of Oracle Develop, the combination of the two conferences formerly known as JavaOne and Oracle OpenWorld. Enebo jokingly called this “Conference-Driven Development.” The first release candidate for version 1.6 should be available in late August.
Meanwhile, the JRuby team is busy putting the final touches on a new book to be published by the Pragmatic Programmers. Co-written by Ola Bini, Ian Dees, Thomas Enebo, Charles O Nutter and Nick Sieger, “Using JRuby: Bringing Ruby to Java” should be available this winter.
The second annual JRubyConf will be held in Columbus, Ohio, on Oct. 1-3.