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


Azure AI And Pgvector Run Generative AI Directly On Postgres
26/03/2024

It's a match made in heaven. The Azure AI extension enables the database to call into various Azure AI services like Azure OpenAI. Combined with pgvector you can go far beyond full text search. Let's  [ ... ]



Call For Code 2024 Focuses On Generative AI
01/03/2024

This year's Call for Code challenge has been launched with a theme of the use of generative AI technology for solutions that aim to improve equitable access to resources and opportunities for historic [ ... ]


More News

 

raspberry pi books

 

Comments




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