{"id":131712,"date":"2025-11-18T10:54:31","date_gmt":"2025-11-18T01:54:31","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=131712"},"modified":"2025-11-18T10:54:31","modified_gmt":"2025-11-18T01:54:31","slug":"ruby-4-0-0-preview2","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/ruby-4-0-0-preview2\/","title":{"rendered":"Ruby 4.0.0 preview2\u30ea\u30ea\u30fc\u30b9\u307e\u3068\u3081\u3002\u6b21\u4e16\u4ee3JIT\u304c\u767b\u5834\uff01"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2025\/11\/ruby.jpg\" alt=\"\" width=\"1280\" height=\"853\" class=\"aligncenter size-full wp-image-131713\" \/><\/p>\n<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f11\u670817\u65e5\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300cRuby\u300d\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u300cRuby 4.0.0-preview2\u300d\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f(<a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2025\/11\/17\/ruby-4-0-0-preview2-released\/\">ruby-lang.org<\/a>)\u3002\u4eca\u56de\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3067\u306f\u3001\u8a00\u8a9e\u4ed5\u69d8\u304b\u3089JIT\u30b3\u30f3\u30d1\u30a4\u30e9\u307e\u3067\u5e45\u5e83\u3044\u6539\u5584\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u6ce8\u76ee\u30dd\u30a4\u30f3\u30c8\u3092\u6574\u7406\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u8a00\u8a9e\u6a5f\u80fd\u306e\u5909\u66f4<\/strong>:<\/p>\n<ul>\n<li>\n<p><span><code>nil.to_a<\/code> \u304c\u547c\u3070\u308c\u306a\u304f\u306a\u308a\u3001\u3088\u308a\u76f4\u611f\u7684\u3067\u4e00\u8cab\u6027\u306e\u3042\u308b\u6319\u52d5\u306b\u3002<code>**nil<\/code> \u304c <code>nil.to_hash<\/code> \u3092\u547c\u3070\u306a\u3044\u4ed5\u69d8\u3068\u7d71\u4e00\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u30b3\u30a2\u30af\u30e9\u30b9\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/strong>:<\/p>\n<ul>\n<li>\n<p><span><strong>Binding<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span><code>local_variables<\/code> \u306b\u756a\u53f7\u4ed8\u304d\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u542b\u307e\u308c\u306a\u304f\u306a\u3063\u305f\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span><code>local_variable_get<\/code> \/ <code>set<\/code> \u3082\u756a\u53f7\u4ed8\u304d\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6271\u308f\u306a\u3044\u3088\u3046\u306b\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span><strong>IO<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span><code>IO.select<\/code> \u304c <code>Float::INFINITY<\/code> \u3092\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u4ed8\u3051\u308b\u3088\u3046\u306b\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span><strong>String \/ Regexp<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span>Unicode 15.1.0 \u3068 Emoji 15.1 \u306b\u5bfe\u5fdc\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span>\u6700\u65b0\u306e\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u30b5\u30dd\u30fc\u30c8\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>JIT\u95a2\u9023\u306e\u5909\u66f4<\/strong>:<\/p>\n<ul>\n<li>\n<p><span><strong>YJIT<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span><code>ratio_in_yjit<\/code> \u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u30d3\u30eb\u30c9\u3067\u7121\u52b9\u5316\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span><code>--enable-yjit=stats<\/code> \u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u6709\u52b9\u5316\u53ef\u80fd\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span><code>invalidate_everything<\/code> \u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7d71\u8a08\u306b\u8ffd\u52a0\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span><code>RubyVM::YJIT.enable<\/code> \u306b <code>mem_size:<\/code> \u3068 <code>call_threshold:<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u8ffd\u52a0\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span><strong>ZJIT<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span>\u5b9f\u9a13\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u30d9\u30fc\u30b9\u306eJIT\u30b3\u30f3\u30d1\u30a4\u30e9\u3092\u8ffd\u52a0\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span><code>--enable-zjit<\/code> \u3067\u6709\u52b9\u5316\u53ef\u80fd\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span>\u307e\u3060\u6027\u80fd\u6539\u5584\u306f\u9650\u5b9a\u7684\u3067\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u307e\u3067\u8a55\u4fa1\u306f\u63a7\u3048\u308b\u3079\u304d\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><span><strong>RJIT<\/strong><\/span><\/p>\n<ul>\n<li>\n<p><span><code>--rjit<\/code> \u304c\u524a\u9664\u3002<\/span><\/p>\n<\/li>\n<li>\n<p><span>\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u5b9f\u88c5\u306f <code>ruby\/rjit<\/code> \u30ea\u30dd\u30b8\u30c8\u30ea\u3078\u79fb\u884c\u3002<\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Ruby 3.4.0\u304b\u3089 3607\u30d5\u30a1\u30a4\u30eb\u304c\u5909\u66f4\u3055\u308c\u3001 197451\u884c\u304c\u8ffd\u52a0\u3055\u308c\u3001285607 \u884c\u304c\u524a\u9664\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Ruby 4.0.0-preview2 \u306f\u3001\u8a00\u8a9e\u4ed5\u69d8\u306e\u4e00\u8cab\u6027\u5f37\u5316\u3001Unicode\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3001\u65b0\u3057\u3044JIT\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u8a66\u9a13\u5c0e\u5165\u306a\u3069\u3001\u6b21\u4e16\u4ee3Ruby\u306b\u5411\u3051\u305f\u6ce8\u76ee\u306e\u6a5f\u80fd\u304c\u591a\u6570\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u3066\u3001\u958b\u767a\u8005\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u306e\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u304c\u671f\u5f85\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u958b\u767a\u30c1\u30fc\u30e0\u306f11\u670817\u65e5\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u300cRuby\u300d\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u300cRuby 4.0.0-preview2\u300d\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f(ruby-lang.org)\u3002\u4eca\u56de\u306e\u30d7\u30ec\u30d3\u30e5\u30fc\u7248\u3067\u306f\u3001\u8a00\u8a9e\u4ed5\u69d8\u304b\u3089JIT\u30b3\u30f3\u30d1\u30a4 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":131713,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[154],"class_list":["post-131712","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-ruby"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/131712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=131712"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/131712\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/131713"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=131712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=131712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=131712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}