Paul Krill
Editor at Large

Ruby 3.1 arrives with new JIT compiler

news
Jan 25, 20222 mins

Still-experimental YJIT just-in-time compiler promises faster warmup and performance improvements on most real-world Ruby software.

hyper convergence speed burning rubber tire binary fast by tao55 getty images
Credit: Toa55 / Getty Images

The Ruby community has released Ruby 3.1, an upgrade to the open source dynamic programming language that introduces a new in-process JIT (just-in-time) compiler to improve the performance of Ruby applications.

Introduced on Christmas Day, Ruby 3.1, or Ruby 3.1.0, adds the YJIT (Yet Another Ruby JIT), a lightweight, minimalistic Ruby JIT built inside CRuby. YJIT uses a Basic Block Versioning architecture, with a JIT compiler inside of it. YJIT achieves fast warmup and performance improvements on most real-world software, Ruby’s developers said. But YJIT still is in an experimental stage and is disabled by default. To use it, developers must specify the –yjit command-line option. YJIT currently is limited to Unix-like x86-64 platforms.

Download instructions for Ruby 3.1 can be found at ruby-lang.org. Other new features and improvements in Ruby 3.1 include:

  • A completely rewritten debug.gem boosts debugging performance and supports remote and multi-process debugging. It also can serve as a front end for the Visual Studio Code editor and Chrome browser and provides a REPL.
  • A built-in gem, error_highlight, offers fine-grained error location in backtraces.
  • The IRB (Interactive Ruby) tool now has an autocomplete feature, where developers type in the code and the completion candidates dialog will appear.
  • TypeProf, a static analyzer, is featured.
  • MJIT compiler performance has been improved.
  • Among the new language features, values in Hash literals and keyword arguments can be omitted, the pin operation (^) in pattern matching now takes an expression, and parentheses can be omitted in one-line pattern matching.
  • Multiple updates have been made to the standard library including updates to default gems such as RubyGems 3.3.3.

Ruby 3.1 arrives one year after Ruby 3.0.0, which featured new parallel execution and type description capabilities.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author