About Me

header ads

Available Ruby 2.6 with JIT compiler in experimental phase

Ruby

It seems that Santa Claus remembered from the programmers, Ruby 2.6.0 was announced , the latest version of the official implementation of one of the most popular programming languages ​​in the world , despite possibly not having much prominence in the media such as Java and JavaScript (the last two have no relationship despite the similarity of the name).

The first thing highlighted by the Ruby managers of version 2.6 is the experimental support for the Just-In-Time compiler (JIT) , which should help improve performance (up to 1.7 times faster than Ruby 2.5). of the programs made with this language. Basically, it is responsible for "writing the C code on the disk and generating a C compiler to generate the native code" . To enable it, you only have to specify "-jit" (without the quotes) in the command line or in the environment variable "$ RUBYOPT. "The JIT compiler is supported when Ruby is compiled with GCC, Clang or Microsoft VC ++."

The other outstanding experimental feature has been "RubyVM :: AbstractSyntaxTree" . "This module has a 'parse' method, which analyzes the string given as Ruby code and returns the AST nodes (Abstract Syntax Tree) of the code" . The class "RubyVM :: AbstractSyntaxTree :: Node" has also been introduced to have the location of the source and the child nodes from the "Node" objects. Being an experimental feature, it is advisable not to use it in production, like the JIT compiler.

Other changes and introduced characteristics are the use of "then" as alias of "yield_self", the names of the constants can now start with a capital letter that is not ASCII , the introduction of unlimited ranges and the addition of "Enumerable#chain" And "Enumerator#+", from the function composition operators "<<" and ">>" to "Proc" and "Method", the "Binding#source_location" method to return the source location of a binding and the option "exception:" in "Kernel # system". Those who want to know all the details of Ruby 2.6.0 can consult the corresponding entry on the official website of this language.

Ruby is a simple language that can come well for those who want to start in the world of programming (like Lua ), since its syntax is simple and allows you to do the same things in several ways (for example, the parentheses in the parameters of the methods are optional). On the other hand, it is the technology with which the Ruby on Rails web application framework is built , from which installation tutorial you can extract the steps to install Ruby 2.6.0 using rbenv.

Post a Comment

4 Comments