Home EducationRuby 4.0.0 Released...
Education⭐ Featured

Ruby 4.0.0 Released

We are pleased to announce the release of Ruby 4.0.0. Ruby 4.0 introduces “Ruby Box” and “ZJIT”, and adds many improvements. Ruby Box Ruby Box is a new (experimental) feature to provide separation about definitions. Ruby Box is enabled when an environment variable RUBY_BOX=1 is specified. The class is Ruby::Box . Definitions loaded in a box are isolated in the box. Ruby Box can isolate/separate monkey patches, changes of global/class variables, class/module definitions, and loaded native/ruby libraries from other boxes. Expected use cases are: Run test cases in box to protect other tests when the test case uses monkey patches to override something Run web app boxes in parallel to execute blue-green deployment on an app server in a Ruby process Run web app boxes in parallel to evaluate dependency updates for a certain period of time by checking response diff using Ruby code Used as the foundation (low-level) API to implement kind of “package” (high-level) API (it is not designed yet) For the detail of “Ruby Box”, see Ruby::Box . [ Feature #21311 ] [ Misc #21385 ] ZJIT ZJIT is a new just-in-time (JIT) compiler, which is developed as the next generation of YJIT. You need Rust 1.85.0 or newer to build Ruby with ZJIT support, and ZJIT is enabled when --zjit is specified. We’re building a new compiler for Ruby because we want to both raise the performance ceiling (bigger compilation unit size and SSA IR) and encourage more outside contribution (by becoming a more traditional method

7 April 2026 at 07:33 am
1 views
Ruby 4.0.0 Released

Ruby 4.0.0 Released: Introducing Ruby Box, ZJIT, and Enhanced Ractor

Ruby developers can celebrate the release of Ruby 4.0.0, which brings significant enhancements and new features to the language. This version introduces two major innovations: "Ruby Box" and "ZJIT," along with numerous improvements to existing components like Ractor.

Ruby Box: Isolation and Separation of Definitions

Ruby Box is a new experimental feature designed to provide separation between definitions. It aims to isolate various aspects such as monkey patches, changes to global or class variables, class/module definitions, and loaded native or Ruby libraries. This feature is particularly useful for scenarios where isolation is critical, such as running test cases that involve monkey patches, executing blue-green deployments for web applications, or evaluating dependency updates.

To enable Ruby Box, users must set the environment variable RUBY_BOX=1. The class associated with this feature is named Ruby::Box. Definitions loaded within a box are kept isolated, ensuring that they do not interfere with other boxes. While the high-level API for implementing "package" functionality is not yet designed, Ruby Box serves as a low-level foundation that can be used to build such features in the future.

ZJIT: The Next-Generation Just-in-Time Compiler

ZJIT, a new just-in-time (JIT) compiler, has been developed as the next generation of YJIT. To build Ruby with ZJIT support, users need Rust 1.85.0 or newer, and ZJIT is enabled by specifying the --zjit option. The Ruby team is building this new compiler to raise the performance ceiling by utilizing bigger compilation unit sizes and SSA (Static Single Assignment) IR. Additionally, the team hopes to encourage more outside contributions by adopting a more traditional compiler method.

While ZJIT is faster than the interpreter, it is not yet as performant as YJIT. Developers are encouraged to experiment with ZJIT, but it is advised to avoid deploying it in production environments until further optimizations are made. Stay tuned for Ruby 4.1, which will likely bring more improvements to ZJIT.

Improvements to Ractor: Enhanced Parallel Execution

Ractor, Ruby's parallel execution mechanism, has received several enhancements in Ruby 4.0.0. A new class, Ractor::Port, has been introduced to address issues related to message sending and receiving. This improvement is expected to provide better stability and performance when dealing with parallel tasks.

Additionally, Ractor.shareable_p has been updated to facilitate sharing data between Ractors more efficiently. These enhancements are designed to make Ractor a more robust and reliable tool for developers working with parallel execution in Ruby applications.

In conclusion, Ruby 4.0.0 represents a significant milestone in the evolution of the Ruby programming language. With the introduction of Ruby Box and ZJIT, along with improvements to Ractor, this release offers developers powerful new tools and enhanced performance. As always, the Ruby community continues to innovate and push the boundaries of what is possible with the language.

Source: Ruby News
📰 Related News
China is using a bacteria to turn desert into fertile soil in just 10 months
China is using a bacteria to turn desert into fertile soil in just 10 months
In a major breakthrough against desertification, researchers at Shapotou Desert Experimental Research Station have developed a technique that can transform barren desert sand into fertile, plant-supporting soil in just 10 months.
28 May
Rising costs ‘crippling’ most farming sectors in NI – FFA
Rising costs ‘crippling’ most farming sectors in NI – FFA
The steering committee of Farmers For Action (FFA) has said that rising fuel, fertiliser, and other costs are now “crippling” most farming sectors in Northern Ireland. The organisation also said that “abysmal” farm gate prices are “breaking the camel’s back”. The FFA said the Department of Agriculture, Environment and Rural Affairs (DAERA) is “making things […] The post Rising costs ‘crippling’ most farming sectors in NI – FFA appeared first on Agriland.ie .
7 Apr
Weather: Strong winds over the weekend and staying unsettled
Weather: Strong winds over the weekend and staying unsettled
The weather this Easter weekend will see strong winds as Storm Dave hits Ireland, and it is set to remain unsettled after that into next week, according to Met Éireann. A Status Yellow warning has been issued for the whole country. This warning will come into effect at 2:00p.m tomorrow afternoon (Saturday, April 4) and […] The post Weather: Strong winds over the weekend and staying unsettled appeared first on Agriland.ie .
7 Apr
Announcing the AWS Sustainability console: Programmatic access, configurable CSV reports, and Scope 1–3 reporting in one place
Announcing the AWS Sustainability console: Programmatic access, configurable CSV reports, and Scope 1–3 reporting in one place
AWS announces the Sustainability console, a new standalone service that consolidates carbon emissions reporting and resources, giving sustainability teams independent access to Scope 1, 2, and 3 emissions data without requiring billing permissions.
7 Apr
Spring grazing: Risk of negative energy balance
Spring grazing: Risk of negative energy balance
Unsettled weather means spring grazing is still quite messy, but its important to push on as the risk of negative energy balances (NEB) rise. NEB is often an issue at this stage, as much of the herd begins to reach their peak milk production but have not yet reached their maximum dry matter intake (DMI). […] The post Spring grazing: Risk of negative energy balance appeared first on Agriland.ie .
7 Apr
Raising the bar: Celebrating the best of West Cork’s dairy farming
Raising the bar: Celebrating the best of West Cork’s dairy farming
At a time when dairy farming is under intense scrutiny, it’s easy to lose sight of what is actually happening on farms across west Co. Cork. Behind the headlines and debates, thousands of family farmers are quietly producing some of the highest-quality, lowest-carbon milk in Europe – while continuing to protect their land, their animals […] The post Raising the bar: Celebrating the best of West Cork’s dairy farming appeared first on Agriland.ie .
7 Apr
How has the wet spring affected feed costs?
How has the wet spring affected feed costs?
We are now in April and yet a good number of herds have very little of the platform grazed, while others still have not seen any grass in 2026 due to the weather. To make matters worse, Met Éireann is still predicting two to three times more than the average rainfall for the week ahead. […] The post How has the wet spring affected feed costs? appeared first on Agriland.ie .
7 Apr
Most Irish dairy cows moved to sheds in March – survey
Most Irish dairy cows moved to sheds in March – survey
The majority of Irish dairy farmers have returned their cattle to sheds in some form due to the wet weather experienced recently, a new survey has found. This is based on the latest Calving Insights Survey conducted by FRS Co-Op for the month of March. The survey found that, despite some spells of dry weather […] The post Most Irish dairy cows moved to sheds in March – survey appeared first on Agriland.ie .
7 Apr
Opinion: Easter has always been a true celebration of Irish sheep production
Opinion: Easter has always been a true celebration of Irish sheep production
Easter has always been synonymous with all that is good about Irish sheep production. And long may this continue to be the case. Spring-born lambs gambolling in fields always epitomise the ending of winter and the promise of better weather to come. It’s just a pity that the spring of 2026 has not lived up […] The post Opinion: Easter has always been a true celebration of Irish sheep production appeared first on Agriland.ie .
7 Apr
The basics of irrigation during hot weather
The basics of irrigation during hot weather
Hot, dry conditions test even the best irrigation strategies. Christo van der Westhuizen, agronomist at Netafim Southern and East Africa, explained to Glenneis Kriel how farmers can manage water efficiently to protect crops during hot days.
7 Apr