Ruby 4.0.0 released, adding new features such as the new JIT compiler ZJIT and Ruby Boxes for isolating class definitions

Ruby is a programming language developed by
Ruby 4.0.0 Released | Ruby
https://www.ruby-lang.org/ja/news/2025/12/25/ruby-4-0-0-released/

Ruby Box is an experimental feature that separates and isolates definitions such as classes, and can be enabled by specifying the environment variable 'RUBY_BOX=1.' Definitions loaded in a box are closed within the box, making it useful for use cases such as 'tests that require patches that overwrite some behavior' or 'running a web application in a closed environment within a box for response verification.'
For more information about Ruby Box, please see the link below.
class Ruby::Box - Documentation for Ruby 4.0
https://docs.ruby-lang.org/en/master/Ruby/Box.html

ZJIT is a JIT compiler developed as the next generation of YJIT. ZJIT was developed to push the performance envelope of Ruby, achieving faster execution than the standard Ruby interpreter.
The graph below shows the performance of 'No JIT (blue),' 'YJIT (green),' and 'ZJIT (yellow).' The horizontal axis shows the build time, and the vertical axis shows the speed improvement compared to when JIT was not used. ZJIT's speed is gradually improving, but at this stage, YJIT is faster, so it is not recommended for use in production environments.

To use ZJIT, you need to specify the '--zjit' option when building Ruby. Building requires Rust 1.85.0 or later. For more information about ZJIT, see the developer blog below.
ZJIT is now available in Ruby 4.0 | Rails at Scale
https://railsatscale.com/2025-12-24-launch-zjit/

Ruby will celebrate its 30th anniversary on December 21, 2025, and the design of its official website has been updated to reflect this . The official Ruby website can be accessed from the following link:
Ruby programming language
https://www.ruby-lang.org/ja/

Related Posts:
in Software, Posted by log1o_hf







