Co-Lead Developer Charles Nutter on JRuby: A High-Performance Implementation of the Ruby Programming Language for the JVM

Co-Lead Developer Charles Nutter on JRuby: A High-Performance Implementation of the Ruby Programming Language for the JVMTL; DR: JRuby, unveiled in 2001, empowers users to reap the main advantages of the Java Virtual Appliance (JVM), including high-performance, true threading, and a vast assortment of libraries. The open-source tool serves as being a fast and accurate rendering of Ruby while delivering robust new features including parallelism, concurrency without a universal interpreter lock (GIL), and close integration while using Java language. Moving onward, the JRuby community will continue focused on ensuring compatibility using Ruby and pursuing additional aggressive optimization. 

Ruby was developed in the 1990s by simply Yukihiro Matsumoto, who named the open-source computing language following birthstone of one involving his colleagues. Since and then, the object-oriented language happens to be increasingly popular, with new versions normally released on Christmas day as being a gift to programmers.

Nevertheless despite its robust capabilities and strong community, Ruby is equipped with its limitations. That’s where JRuby — a comfortable, high-performance, fully threaded implementation in the Ruby programming languages to the Java Virtual Machine (JVM) — also comes in.

“We’re the next step to the high end-traffic users when a credit application gets to a place where regular Ruby is just not scaling up well ample, ” said Charles Oliver Nutter, Co-Lead Builder of JRuby.

JRuby logoJRuby is surely an open-source implementation of your Ruby language for Caffeine Virtual Machine (JVM).Your free, open-source software is unveiled under a three-part EPL/GPL/LGPL license and is just like the Ruby interpreter nevertheless written in Java. For that reason, it serves as a timely and accurate implementation involving Ruby while providing robust new features including parallelism, concurrency without a universal interpreter lock (GIL), and close integration while using Java language.

Like Dark red, JRuby includes object-oriented coding and dynamic typing. But it is usually tightly integrated with Caffeine, empowering users to reap the main advantages of JVM, including high functionality, real threading, and an enormous array of libraries.

Regarding frameworks, JRuby supports RSpec, Rake, along with RubyGems. JRuby has recently been able to run your Ruby on Rails web framework since May 2006 release involving version 0. 9. Crimson Hat, a leading company of enterprise open origin solutions, has sponsored develop JRuby since 2012. Continuing to move forward, the JRuby community will continue focused on ensuring compatibility using Ruby and pursuing additional aggressive optimization.

Enabling Dependable, Fully Threaded Java Rendering Atop the JVM

JRuby’s co-lead builders are Charles and Jones Enebo, but past builders, including Ola Bini along with Nick Sieger, also contributed on the software. It was initially released 19 rice in 2001.

“In JRuby’s conception, when the first commits started being released, there was mostly desire for getting Ruby tooling for the JVM, ” Charles explained. “So they started while using parser and whatnot then again rapidly moved toward quite basic Ruby implementation. ”

While Charles joined in 2005, the team attempted to run the libraries and applications that men and women used in the Ruby community — including package installers. “About 12 months later, we actually went about getting Ruby to run your Ruby on Rails world wide web framework. That was an exilerating moment; it was if we realized we could can certainly make JRuby a useful instrument for folks. ”

Over the last 15 possibly even years, the JRuby community features witnessed massive shifts inside JRuby and Java growth space.

“The arrival of Train track in 2004 changed how applications get working, ” Charles said. “Now, pretty much every framework has at very least sensible defaults. Most ones have application generators, although before, you had to do a great deal of hand configuration. ”

Charles explained that though it’s tough to quantify the use rate of JRuby exclusively, the team has witnessed thousands of users in the past, some of whom employ JRuby on extensive purposes, such as banking internet sites and election results sites to the BBC.

“We’ve never tried becoming a replacement for regular Dark red, ” Charles said. “If Ruby is scaling very well for you, if that tool works for ones application, then maybe that’s as well as it needs to be in your case. JRuby is the collection of a smaller percentage in the folks out there, but that still means hundreds of thousands of apps. ”

Tapping into the main advantages of the JVM Environment

Charles told us that will JRuby’s main advantages are derived from using Ruby on a new JVM. Essentially, this capability gives Ruby entry to anything that can are powered by a JVM, including rule in other languages.

Putting the Ruby coding language atop the JVM allows developers to develop, package, and distribute applications to absolve users on multiple websites.

“The return on investment is the same as what you’d get gonna a JVM, ” Charles explained. “It’s Ruby first but tough capabilities of the Caffeine platform behind it. ”

JRuby enable you to access powerful JVM capabilities, including libraries.

With JRuby, developers will use both Ruby and Caffeine libraries. They can in addition access the Java waste collection feature, a memory management instrument that finds and removes unused objects to get back space, and the JVM just-in-time (JIT) compiler, which compiles bytecode straight into native code at run time for it to improve performance.

Once developers decide to get started with your platform-independent language, they’ll expertise easy installation and migrations, using few hassles.

Ensuring Compatibility while using Standard Ruby

When it relates to internal development, the JRuby community focuses primarily on two concerns, the most urgent of which is maintaining compatibility while using standard Ruby programming words.

“That means handling individual reports when there’s some edge case of an feature that we don’t assist, ” Charles said. “It requires investigating the new version of Ruby on a yearly basis, making sure that many of us have the same changes to implementation, and making confident we match feature pertaining to feature. ”

The most up-to-date version of JRuby, 9. only two. x, is compatible using Ruby 2. 5. a and stays in sync with C Ruby. Charles told us these compatibility issues undertake about 75% of growth time.

“The remaining 25% almost daily is spent focused on users in the Java platform; whether they’re looking to integrate it with various other Java libraries or straight into an enterprise stack, we’re being sure that works, ” he explained. “We’re also leveraging your JVM itself better: Doing a more satisfactory job of optimizing code, minimizing allocation, making sure that we’re staying good JVM citizens so you can pass all those benefits on Ruby users. ”

Way up Next: Pursuing More Ambitious Optimization

Charles told us that in the last two years or consequently, JRuby’s developers made great strides regarding Ruby compatibility.

“Every time a whole new Ruby version comes out and about, we’re only a phase behind, ” he explained. “It’s maybe another month’s worthy of of work to catch up the many features, and that’s started to free up additional time to look at aggressive optimizations plus much more advanced ways of compiling Ruby code into JVM bytecode. ”

This means the team can spend about 50 % of of its time on compatibility plus the other half on functionality.

“Over the next calendar year, I think we’re gonna start seeing performance results in areas we didn’t have time for it to spend on before, ” they said.