Ruby 3.3 Published

Ruby 3.3.0 release has recently been announced. Ruby is a dynamic object-oriented programming language known for its efficiency in program development. It combines the best features from languages like Perl, Java, Python, Smalltalk, Eiffel, ADA, and LISP. The project code is distributed under BSD licenses (“2-Clause BSDL”) as well as “Ruby,” which is compatible with GPLV3.

The main improvements included in this release are as follows:

  • The main composition is now integrated with the parser prism. Prism, implemented in the form of the Libprism SI Biblioteum, is used in the Cruby interpreter and the Ruby Gem Pacet. It provides a public API for recursive analysis of Ruby code, suitable for use in working projects instead of the Ripper parser. Prism offers advantages such as good tolerance and flexible error processing in the code. To activate the new parser, use the option “Ruby –Parser = Prism” or set the environment variable Rubyopt = “-Parser = Prism”. The PRISM.PARSE method is available for obtaining AST-reporting code, prism.parse_comments to highlight comments from code, and prism.parse_success? to check for errors in the code.
  • The project now uses the lrama package instead of the external Bison package. Lrama implements the lalr algorithm, which is compatible with Bison and used in Cruby for defining grammar (Parse.y). Lrama provides advanced features such as error processing and parameterized rules (?, *, +).
  • A significant optimization has been made to the performance of the JIT-compiler yjit. Yjit, developed by the SHOPIFY electronic commerce platform, aims to enhance the performance of Ruby programs using the Rails framework. Yjit utilizes Lazy Basic Block Versioning (LBBV) to compile only the beginning of a method at first and compile the remaining part after determining the types of variables and arguments during execution. This optimization leads to a boost in performance, especially for methods that are frequently called. Previous JIT compilers like MJIT have been replaced by YJIT, which is written in Rust.
/Reports, release notes, official announcements.