JVM scripting language No. 2: JRuby -- a better Ruby than Ruby?
JRuby is a Java port of the Ruby language. Ruby itself is a scripting language developed in the mid-1990s in Japan, where it has enjoyed wide adoption. The language was a sleeper in the United States and Europe until its killer app, Ruby on Rails, was released in 2004. Using a set of conventions that made assembling the various parts of Web applications much easier, Rails was quickly put to use in developing websites for small and medium-sized businesses. The popularity of Rails led to an explosion of interest in Ruby.
The Ruby language has many of the features I've described in Groovy, but it uses a terser syntax -- allowing developers to get more work done per line of code written. The big problem Ruby faced was performance. In multiple benchmarks, it came in last or close to last when compared with all other languages. This spurred numerous competing projects to rewrite Ruby. Of these, the most successful has been JRuby.
The JRuby project was started in 2001 as a straight port of Ruby code. By 2007, the project -- now under the control of a pair of engineers at Sun, Charles Nutter and Thomas Enebo -- could run Ruby on Rails and delivered performance comparable to non-Java Ruby. Since then, the developers have moved to Engine Yard, a commercial host for Ruby on Rails, where work on JRuby has continued apace. In the meantime, Ruby released the much faster 1.9 version. According to Nutter, JRuby's performance is now comparable with this release.
Like Ruby, JRuby is attractive to developers for more than its very high-level syntax. It also enjoys a pure object-oriented implementation (unlike Java, where some entities are objects and others are not), closures, duck typing (a concept similar in effect to type inference), and an interpreter. The use of an interpreter means that you can move from coding to execution immediately. What JRuby has that Ruby lacks are the vast libraries of the Java platform. Ruby has many good libraries, but they are neither as numerous nor as widely used as the standard Java libraries.
The access to Java's runtime environment and libraries is a crucial aspect in determining JRuby's future. Ruby has not broken into the enterprise in a big way. JRuby may well be its ticket there. JRuby has the advantage that enterprises are already comfortable running apps on the JVM, whereas the native Ruby virtual machine is an unknown element whose peculiarities are not known to stokers in the data center. In addition, because of the integration with Java apps, companies can adopt Ruby via JRuby and still leverage previous investment in Java software.
Whether enterprises will favor Groovy or JRuby depends entirely on the needs felt inside the IT development center. Both solutions work well, are supported by paid developers (rather than by volunteers), have growing support among tool vendors, and are likely to be around for a while, delivering working code quickly.
Having trouble installing and setting up Win10? You aren’t alone. Here are many of the most common...
Win7 Update scans got you fuming? Here’s how to make the most of Microsoft’s 'magic' speed-up patch
Picking an Android phone can be difficult, but we're here to help. These are the top Android phones you...
Confidence in our power over machines also makes us guilty of hoping to bend reality to our code
Developers shouldn't use JSON Web Tokens or JSON Web Encryption in their applications at all, lest...
Oracle's Bob Weiler weighs in on his company's SaaS-centric enterprise cloud strategy and the long,...
The Neurala Developers Program uses C++ for building smart apps and doesn't require developers to...