JRuby

What is JRuby

A multipurpose language that focuses on simplicity and productivity, it combines the best features of many compiled and interpreted languages, such as easy development of large programs, rapid prototyping, almost-real-time development, and compact code. Ruby is a reflective, dynamic, and interpreted object-oriented scripting language, and JRuby is a Java programming language implementation of the Ruby language syntax, core libraries, and standard libraries.

Java implementation of Ruby language started in 2002.

Its open source and has many contributors

  • 100% Java implementation of Ruby
  • Open Source, GPL/LGPL/CPL licensed
  • Not yet a Ruby-to-bytecode compiler
  • Native-threaded
  • Runs on Java SE versions 1.4.2 or higher
  • Started in Fall of 2001 based on Ruby 1.6

Releases

JRuby 1.3.1 is the latest release

  • 1. June 2007: 1.0 release, focus on compatibility
  • 2. April 2008: 1.1 release, focus on performance
  • Aiming for compatibility with current Ruby version

JRuby Design Goals

  • Bring beauty of Ruby to Java world
  • Bring Java echo-system to Ruby world
  • Enable highly scalable and highly performing Ruby implementation

Why JRuby

  • With JRuby you get the best of both worlds: Ruby applications and libraries, plus Java libraries. And you can access those libraries with Ruby syntax (or Java syntax, if you want).
  • On average JRuby, runs 2 and a half times faster than Ruby, except at startup
  • In addition to native threads, JRuby supports Unicode natively.
  • Code can be fully compiled ahead of time or just in time.
  • A JRuby on Rails application can be packaged into a WAR, and then deployed onto any compliant server.
  • The packaging of creating a war file from Rails can be done with Goldspike, or with the new kid on the block: Warbler.
  • Can use vast array of Java libraries- JPA, JTA, JMS, EJB, JDBC, JMX, JSF, etc.
  • Database connections are made through JDBC, which provides broader, more scalable database support.
  • Glassfish--the Java web app server that scales well—is available as Jruby gem

Features

With JRuby, you get all of the advantages of Ruby plus-

  • Interoperability with Java platform applications (Java applications)
  • Provides access to the full range of Java platform functionality
  • JRuby and the Java platform are a compelling combination that you can apply to any programming situation.
  • From a JRuby script, you can call the Java platform Math library to access its powerful computational capabilities or call the Java platform Swing library to display a dialog box that requires end-user input before allowing the script to proceed.
  • You can use the JSR 223 Scripting APIs or the Bean Scripting Framework (BSF) APIs to call a JRuby script from within a Java application to, for instance, invoke back-end processing scripts from a servlet to update or generate web content
 
  • Leverage language features found in ruby inside java programs
  • Ruby plugins in a java application
  • Scripting java applications
  •  
  • Simpler syntax: JRuby contains no statement terminator (e.g. the semicolon in the Java) and allows the omission of parentheses in function calls that have no arguments.
  • Variables are untyped, hence there is no need for declarations.
  • Member attributes of classes can be specified as readable and/or writable and can be accessed by name
  • Blocks and iterators make it easier to do repetitive evaluations, especially of collection members.
  • Extensive string and regular-expression features make text-processing very simple.

Advantages

  • Import Java classes into Ruby
  • Implement Java interfaces from Ruby
  • Runs with Ruby’s standard libraries
  • Native threading: Ruby thread == Java thread
  • Call java code from ruby code (using the jruby interpreter)
  • Make use of company’s investment in java-code
  • Make use of open source java libraries when better/faster than ruby alternatives
  • Make use of commercial java libraries
  • No previous JRuby knowledge –very easy to learn
  • Integration with company internal java-based software was very easy
  • Netbeans v 6 adds good support for JRuby, Ruby and Rails development

Conclusion

JRuby is a powerful and flexible language that offers a rich library and extensive features. Reusing sourcecode written in Java works perfectly. Deploying to a Java-based application server works flawlessly.
Its support of iterators, its convenient text-processing functions, and, of course, its access to the vast set of class Java libraries and APIs provide an excellent environment in which to quickly and easily write robust applications, large or small.

 
 

Latest News

"phpProBid v6.05 & Joomla v1.5.14 bridge component"
New project “phpProBid v6.05 & Joomla v1.5.14 bridge component”awarded from Vincent.

Logo

Logo

Logo

Logo

 

Logo

oDesk Certified oDesk Professional

 

Agreed by Terms & Conditions | Privacy policy

© 2007 - 2010 Octal info Solutions Pvt. Ltd, All Rights Reserved.

This site is validate from W3C.

Banner
XHTML
Banner
CSS 2.0