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

 

Banner


VLOGGER - AI Does Talking Heads
24/03/2024

Developed by Google researchers VLOGGER AI is a system that can create realistic videos of people talking and moving from a single still image and an audio clip as input. 



Google Introduces JPEG Coding Library
15/04/2024

Google has introduced Jpegli, an advanced JPEG coding library that maintains high backward compatibility while offering enhanced capabilities and a 35% compression ratio improvement at high quality co [ ... ]


More News

 

raspberry pi books

 

Comments




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