Ruby 4.0.0 introduces ZJIT compiler, Ruby Box isolation
Ruby 4.0.0 has arrived as the newest release of the interpreted, object-oriented Ruby programming language. The update features a new just-in-time compiler, ZJIT, and an experimental “Ruby Box” capability for in-process separation of classes and modules.
Released on December 25, 2025, Ruby 4.0.0 can be downloaded from ruby-lang,org.
Ruby Box is a new feature designed to provide separate spaces in a Ruby process for isolating code, libraries, and monkey code. Anticipated use cases for Ruby Box include running test cases in a box to protect other tests when the test case uses monkey patches for overriding something, running web app boxes in parallel for blue-green deployments on an app server in a Ruby process, and running web app boxes in parallel to evaluate dependency updates for a specific time period by checking response diffs. Note that Ruby Box is currently experimental and comes with a few known issues.
Ruby 4.0.0 also introduces ZJIT, a new just-in-time compiler intended to be the next generation of YJIT. Built into Ruby’s YARV reference implementation, ZJIT is faster than the interpreter, but not yet as fast as YJIT. Developers are encouraged to experiment with ZJIT, but maybe hold off on deploying it in production for now. Users are advised to stay tuned for Ruby 4.1 ZJIT.
Also in Ruby 4.0.0, Ruby’s parallel execution mechanism, Ractor, has received improvements including a new class, Ractor:port, to address issues pertaining to message sending and receiving, and Ractor.shareable_proc, to make it easier to share Proc objects between Ractors. For performance, many internal data structures in Ractor have been improved to reduce contention on a global lock, thus resulting in better parallelism. Ractors now also share less internal data, resulting in less CPU contention when running in parallel.
Ruby first emerged in 1995. Other features in Ruby 4.0.0 include the following:
*nilno longer callsnil.to_a, similar to how**nildoes not callnil.to_hash.- For core classes,
Array#rfindhas been added as a more efficient alternative toarray.reverse_each.find. Enumerator.producenow accepts an optionalsizekeyword argument to specify the enumerator size.Kernel#inspectnow checks for the existence of an#instance_variables_to_inspectmethod, allowing control over which instance variables are displayed in the#inspectstring.
Original Link:https://www.infoworld.com/article/4113436/ruby-4-0-0-introduces-zjit-compiler-ruby-box-isolation.html
Originally Posted: Tue, 06 Jan 2026 23:45:15 +0000












What do you think?
It is nice to know your opinion. Leave a comment.