What’s new in Ruby 4.0 - The Miners
blog.codeminer42.com·12h
🎮Bevy ECS
Preview
Report Post

It is that time of the year again! As tradition dictates, Christmas is approaching, and with it comes the gift of a new Ruby release.

I experimented with Ruby 4.0.0-preview3 for a few days, and I am excited to share with you the highlights of this upcoming version.

Let’s dive into what’s new and what makes this release special.

What’s new in core classes

Ruby::Box

This new feature was introduced to provide a way to create isolated context executions within the same Ruby process.

It allows you to run code in a separate "box" that has its own global variables, constants, and class definitions.

Take the following code as an example:

# file: greetings.rb
class String
def shout
self.upcase...

Similar Posts

Loading similar posts...