The JRuby team this week announced the availability of JRuby 9000, the ninth major release of the JRuby programming language.
JRuby is an implementation of the Ruby programming language on top of the Java virtual machine (JVM), bringing parallelism, increased performance and enhanced garbage collection to the Ruby world.
“JRuby provides a migration path for Ruby applications that ‘grow up,'” said Charles Oliver Nutter, co-lead of the JRuby project and a senior engineer at Red Hat. “Eventually any successful Ruby app will get to the point where memory and horizontal scaling are important. When they reach that point, JRuby is there for them. JRuby is, in a sense, ‘enterprise-grade Ruby.'”
The team opted for JRuby 9000 as a code name and 9.0.0.0 as a version number to separate it from Ruby’s version numbers—1.8, 1.9, 2.0. The team has been working on this release for three years, and it is the single largest JRuby release they have ever done.
“The biggest advance in this release is the jump from Ruby 1.9.3 compatibility to Ruby 2.2,” Nutter said. “This means we’re finally caught up with C Ruby and can release in lock-step as they come out with new features. Of course the new optimizing runtime is also a huge change for us, and we’re expecting to lean on it a lot in the coming months to bring Ruby performance closer to C and Java.”
The language’s execution runtime has been completely rewritten over the past five years, enabling anyone who has taken a college compilers course to contribute to improving JRuby performance, Nutter said. Several subsystems, like I/O and process management, now use the same native functionality as the C-based version of Ruby. This greatly improves compatibility with standard POSIX and Unix behavior, he noted.
Although this first release was not intended to be significantly faster than JRuby 1.7, the team has already received reports of improved performance. Upcoming releases will leverage the new compiler to increase performance further.
JRuby 9000 now uses native operations for much of I/O and almost all of Process. This makes it the first POSIX-friendly JVM language, with full support for spawning processes, inheriting open streams, performing non-blocking operations on all types of I/O and generally fitting well into a POSIX environment, Nutter said.
“You can call into other JVM languages, deploy on Java servers, and take advantage of the massive Java tooling ecosystem,” the JRuby team said in a post on the JRuby blog. “At the same time, ‘It’s Just Ruby’ … we pride ourselves on compatibility and on being a Ruby implementation first, and a JVM language second.”
With JRuby 9000, Java 7 is now the minimum Java version. “We use many Java 7 features, and so JRuby requires a Java 7 JVM and JDK [Java Development Kit] to run,” Nutter said. And Ruby compatibility is now up to the Ruby 2.2 specification, a leap forward from JRuby 1.7’s compatibility with Ruby 1.9.3. This includes all language and syntax features and many updates to core libraries.
JRuby 9000’s final release comes after two previews and two release candidates. The team said it should be stable for all users, and they recommend upgrading. The team also plans to do several maintenance releases over the coming months to address new issues.