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.

rubylogo2a

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.

rubylogo2a

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, FacebookGoogle+ or Linkedin.

 

Banner


IBM To Acquire Red Hat For $34 Billion
29/10/2018

IBM has agreed to acquire Red Hat for $190 per share in cash in the biggest Linux or open-source business deal ever. It is Red Hat's hybrid cloud platform, rather than Linux, that IBM wants.



Google To Charge For Its Android Apps In The EU - Update: Annual Revenue of $5 Billion
22/10/2018

The European Commission's strong approach to controlling all things computing might be a good thing, but it is certainly creating a two-tier environment. Google is now going to charge for its Android  [ ... ]


More News

 

Python

 



 

Comments




or email your comment to: comments@i-programmer.info