Ruby 3.1 Arrives With the Experimental YJIT Compiler
Ruby 3.1.0 shipped on Christmas Day 2021 with Shopify's new YJIT in-process JIT, a rewritten debug gem, and error_highlight for sharper backtraces.
Historical Archive. This article documents an event from 2021 and is preserved with its original date for reference. It is not current news, and details may have changed since publication.
Ruby 3.1 lands on Christmas Day
Ruby 3.1.0 was released on December 25, 2021, continuing the project's tradition of shipping a major version each Christmas. The core team said 3.1 keeps compatibility with Ruby 3.0 while adding many features, and the release notes tallied 3,124 files changed with more than 551,000 insertions since Ruby 3.0.0.
YJIT, a new in-process JIT
The headline addition was YJIT, a new in-process JIT compiler developed by Shopify. Unlike the existing method-based MJIT, which shells out to an external C compiler, YJIT uses Lazy Basic Block Versioning to compile the beginning of a method first and incrementally compile the rest as argument and variable types become known. Ruby said YJIT delivered both fast warmup and real-world gains, up to 22% on railsbench and 39% on liquid-render. It shipped disabled by default as an experimental feature, enabled with the --yjit flag and limited to Unix-like x86-64 platforms at launch.
A rewritten debugger and better errors
Ruby 3.1 bundled a completely rewritten debug gem that adds remote debugging, rich frontends for VS Code and Chrome, multi-process and multi-thread debugging, and a colorful REPL, replacing the older lib/debug.rb. The new error_highlight gem, enabled by default, points at the exact fragment of a line that raised a NoMethodError, and IRB gained autocomplete with an inline documentation dialog.
Language and typing updates
Hash literals and keyword arguments gained value omission, so {x:, y:} is now shorthand for {x: x, y: y}. The pin operator in pattern matching can take an expression, and one-line pattern matching lost its experimental label. On the typing side, RBS added bounded generics and the rbs collection tool, while TypeProf gained an experimental 'TypeProf for IDE' mode for VS Code.
Related on Skillo
See also: Ruby 3.2 and production-ready YJIT, Rails 7.0 and the no-Node front end.
Sources
Published date reflects the original event date (2021-12-25). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.
Written by
Skillo Staff
0 Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.