Ruby 4.0 released with Ruby Box isolation, ZJIT compiler, Ractor improvements, and more
alternativeto.net·1d
🔮Clojure
Preview
Report Post

Ruby 4.0 has been released, introducing a major update to this general-purpose programming language. This version debuts Ruby Box as an experimental feature for code isolation. When enabled using the RUBY_BOX=1 environment variable, Ruby Box contains definitions and isolates them within the Ruby::Box class. This mechanism separates monkey patches, global or class variable changes, class or module definitions, and loaded native or Ruby libraries across distinct boxes.

At the runtime level, Ruby 4.0 introduces the ZJIT just-in-time compiler. ZJIT is developed as the next generation of the YJIT compiler and brings improved performance for many use cases. Developers must use

Ruby 4.0 has been released, introducing a major update to this general-purpose programming language. This version debuts Ruby Box as an experimental feature for code isolation. When enabled using the RUBY_BOX=1 environment variable, Ruby Box contains definitions and isolates them within the Ruby::Box class. This mechanism separates monkey patches, global or class variable changes, class or module definitions, and loaded native or Ruby libraries across distinct boxes.

At the runtime level, Ruby 4.0 introduces the ZJIT just-in-time compiler. ZJIT is developed as the next generation of the YJIT compiler and brings improved performance for many use cases. Developers must use Rust 1.85.0 or newer to build Ruby with ZJIT enabled, which requires specifying the --zjit build option.

Following these major features, Ractor’s parallel execution system gains new capabilities. The Ractor::Port class addresses message sending and receiving issues and enables easier communication. Ractor.shareable_proc also simplifies sharing Proc objects between Ractors. Several internal improvements reduce contention on global locks and minimize CPU cache contention, improving parallel execution.

For Windows users, Ruby 4.0 now requires Visual Studio 2015 or later, dropping support for older Microsoft Visual C++ compilers. Additional updates include changes to the language, standard library, core classes, implementation, and C API, among others.

View article on AlternativeTo »

More about Ruby | Ruby Alternatives

Similar Posts

Loading similar posts...