Ruby 2.6 Adds JIT
Written by Kay Ewbank   
Monday, 11 June 2018

There's a new preview of Ruby that is the first in the Ruby 2.6.0 series. The developers say the preview has been released earlier than usual because it includes an important new feature, JIT.

Ruby is a very popular programming language partially due to the the fact that it is fun to use, and useful because of its mix of different programming styles - functional, dynamic and object-oriented.


The JIT is the major improvement to the new version. The Just-In-Time compiler will make programs execute faster, and is interesting because the developers say that it works differently from JIT compilers in other languages. Ruby’s JIT compiler prints C code to a disk and spawns a common C compiler process to generate native code. The preview release has been made so that users of Ruby can check if it works for their particular platform and will also discover any security risks before the 2.6 release. The JIT compiler is currently only supported when Ruby is built by gcc or clang and the compiler is available on runtime.

The developers say that this version of the JIT is an early one and very few optimizations are implemented, so it's not ready for benchmarking final performance, especially for larger programs like Rails applications. Future versions will include method inlining, which is expected to increase Ruby’s performance in order of magnitude.

Away from the JIT compiler, the preview includes a new module, RubyVM::AST. This module has a parse method that parses a given ruby code that's a string, and returns a set of AST (Abstract Syntax Tree) nodes. The module also has a parse_file method that parses a given Ruby code file and returns AST nodes.

Other new features include the addition of an endless range that you can use without specifying how large the range is; and an Add Binding#source_location method that returns the source location in the form of a two element array containing the file and line.


More Information

Ruby Official Site

Related Articles

Ruby 2.5 Adds Support For Branch Coverage

Commercial Ruby Distro Enters Beta

Ruby On Rails Reaches 5.0

Ruby 2.3 Released

ActiveState Extends to Ruby, Node.js, Go and Lua

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, Facebook or Linkedin.



Apache Arrow 2 Improves C++ and Rust Support

There's a new release of Apache Arrow with improvements to the support for C++ and Rust, particularly in support for Parquet.

Deep Learning Restores Time-Ravaged Photos

Researchers have devised a novel deep learning approach to repairing the damage suffered by old photographic prints. The project is open source and a PyTorch implementation is downloadable from GitHub [ ... ]

More News






or email your comment to: