{"id":50610,"date":"2026-01-01T20:39:50","date_gmt":"2026-01-02T01:39:50","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=50610"},"modified":"2026-01-01T20:39:50","modified_gmt":"2026-01-02T01:39:50","slug":"ruby-4","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2026\/01\/01\/ruby-4\/","title":{"rendered":"Ruby 4"},"content":{"rendered":"<p><a href=\"https:\/\/www.ruby-lang.org\/en\/news\/2025\/12\/25\/ruby-4-0-0-released\/\">naruse<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=46382011\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.ruby-lang.org\/en\/news\/2025\/12\/25\/ruby-4-0-0-released\/\">\n<p>Ruby Box is a new (experimental) feature to provide separation about definitions. Ruby Box is enabled when an environment variable <code>RUBY_BOX=1<\/code> is specified. The class is <code>Ruby::Box<\/code>.<\/p>\n<p>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.<\/p>\n<p>[&#8230;]<\/p>\n<p>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 <code>--zjit<\/code> is specified.<\/p>\n<p>We&rsquo;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 compiler). See <a href=\"https:\/\/railsatscale.com\/2025-12-24-launch-zjit\/\">our blog post<\/a> for more details.<\/p>\n<p>[&#8230;]<\/p>\n<p>Ractor, Ruby&rsquo;s parallel execution mechanism, has received several improvements. A new class, <code>Ractor::Port<\/code>, was introduced to address issues related to message sending and receiving (see <a href=\"https:\/\/dev.to\/ko1\/ractorport-revamping-the-ractor-api-98\">our blog post<\/a>).<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>naruse (Hacker News): 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2026-01-02T01:39:53Z","apple_news_api_id":"a7ddf6ff-5130-40fe-94da-343b5bde6ddd","apple_news_api_modified_at":"2026-01-02T01:39:54Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/Ap932_1EwQP6U2jQ7W95t3Q","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[255,817,46,71,287],"class_list":["post-50610","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-compiler","tag-just-in-time-compilation-jit","tag-languagedesign","tag-programming","tag-ruby"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=50610"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50610\/revisions"}],"predecessor-version":[{"id":50611,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50610\/revisions\/50611"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=50610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=50610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=50610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}