CINXE.COM

Ruby 3.4.0 preview2 Released

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Ruby 3.4.0 preview2 Released</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta itemprop="image" content="https://www.ruby-lang.org/images/header-ruby-logo@2x.png"> <meta name="description" content=""> <link rel="stylesheet" type="text/css" href="/stylesheets/normalize.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/main.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/pygments.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/mobile.css"> <link rel="stylesheet" type="text/css" href="/stylesheets/print.css"> <link href='https://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic&amp;subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'> <link rel="canonical" href="https://www.ruby-lang.org/en/news/2024/10/07/ruby-3-4-0-preview2-released/"> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"> <link href="/en/feeds/news.rss" rel="alternate" title="Recent News (RSS)" type="application/rss+xml"> <script type="text/javascript" src="/javascripts/jquery.min.js"></script> <script type="text/javascript" src="/javascripts/page.js"></script> </head> <body> <div id="header"> <div id="header_content" class="container"> <a href="/en/"> <h1>Ruby</h1> <h2>A Programmer's Best Friend</h2> </a> <div class="site-links"> <a href="/en/" class="home">Home</a> <a href="/en/downloads/">Downloads</a> <a href="/en/documentation/">Documentation</a> <a href="/en/libraries/">Libraries</a> <a href="/en/community/">Community</a> <a href="/en/news/">News</a> <a href="/en/security/">Security</a> <a href="/en/about/">About Ruby</a> <a href="#" class="menu selected">Menu</a> </div> <div id="search-box"> <form id="search-form" action="https://www.google.com/cse"> <table class="fieldset"> <tr> <td> <input class="field" type="text" name="q" size="31" style="background: white url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat" onfocus="this.style.background='white'" onblur="if (/^\s*$/.test(this.value)) this.style.background='white url(//www.google.com/coop/intl/en/images/google_custom_search_watermark.gif) left no-repeat'"/> </td> <td> <input type="hidden" name="cx" value="013598269713424429640:g5orptiw95w" /> <input type="hidden" name="ie" value="UTF-8" /> <input class="button" type="submit" name="sa" value="Search" /> </td> </tr> </table> </form> </div> </div> </div> <div id="page"> <div id="main-wrapper" class="container"> <div id="main"> <div id="content-wrapper"> <h1>Ruby 3.4.0 preview2 Released</h1> <div id="content"> <p class="post-info">Posted by naruse on 7 Oct 2024</p> <p>We are pleased to announce the release of Ruby 3.4.0-preview2.</p> <h2>Prism</h2> <p>Switch the default parser from parse.y to Prism. [<a href="https://bugs.ruby-lang.org/issues/20564">Feature #20564</a>]</p> <h2>Language changes</h2> <ul> <li> <p>String literals in files without a <code class="language-plaintext highlighter-rouge">frozen_string_literal</code> comment now emit a deprecation warning when they are mutated. These warnings can be enabled with <code class="language-plaintext highlighter-rouge">-W:deprecated</code> or by setting <code class="language-plaintext highlighter-rouge">Warning[:deprecated] = true</code>. To disable this change, you can run Ruby with the <code class="language-plaintext highlighter-rouge">--disable-frozen-string-literal</code> command line argument. [<a href="https://bugs.ruby-lang.org/issues/20205">Feature #20205</a>]</p> </li> <li> <p><code class="language-plaintext highlighter-rouge">it</code> is added to reference a block parameter. [<a href="https://bugs.ruby-lang.org/issues/18980">Feature #18980</a>]</p> </li> <li> <p>Keyword splatting <code class="language-plaintext highlighter-rouge">nil</code> when calling methods is now supported. <code class="language-plaintext highlighter-rouge">**nil</code> is treated similarly to <code class="language-plaintext highlighter-rouge">**{}</code>, passing no keywords, and not calling any conversion methods. [<a href="https://bugs.ruby-lang.org/issues/20064">Bug #20064</a>]</p> </li> <li> <p>Block passing is no longer allowed in index. [<a href="https://bugs.ruby-lang.org/issues/19918">Bug #19918</a>]</p> </li> <li> <p>Keyword arguments are no longer allowed in index. [<a href="https://bugs.ruby-lang.org/issues/20218">Bug #20218</a>]</p> </li> </ul> <h2>Core classes updates</h2> <p>Note: We’re only listing outstanding class updates.</p> <ul> <li> <p>Exception</p> <ul> <li><code class="language-plaintext highlighter-rouge">Exception#set_backtrace</code> now accepts an array of <code class="language-plaintext highlighter-rouge">Thread::Backtrace::Location</code>. <code class="language-plaintext highlighter-rouge">Kernel#raise</code>, <code class="language-plaintext highlighter-rouge">Thread#raise</code> and <code class="language-plaintext highlighter-rouge">Fiber#raise</code> also accept this new format. [<a href="https://bugs.ruby-lang.org/issues/13557">Feature #13557</a>]</li> </ul> </li> <li> <p>Range</p> <ul> <li><code class="language-plaintext highlighter-rouge">Range#size</code> now raises <code class="language-plaintext highlighter-rouge">TypeError</code> if the range is not iterable. [<a href="https://bugs.ruby-lang.org/issues/18984">Misc #18984</a>]</li> </ul> </li> </ul> <h2>Compatibility issues</h2> <p>Note: Excluding feature bug fixes.</p> <ul> <li>Error messages and backtrace displays have been changed. <ul> <li>Use a single quote instead of a backtick as a opening quote. [<a href="https://bugs.ruby-lang.org/issues/16495">Feature #16495</a>]</li> <li>Display a class name before a method name (only when the class has a permanent name). [<a href="https://bugs.ruby-lang.org/issues/19117">Feature #19117</a>]</li> <li><code class="language-plaintext highlighter-rouge">Kernel#caller</code>, <code class="language-plaintext highlighter-rouge">Thread::Backtrace::Location</code>’s methods, etc. are also changed accordingly.</li> </ul> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Old: test.rb:1:in `foo': undefined method `time' for an instance of Integer from test.rb:2:in `&lt;main&gt;' New: test.rb:1:in 'Object#foo': undefined method 'time' for an instance of Integer from test.rb:2:in '&lt;main&gt;' </code></pre></div> </div> </li> <li><code class="language-plaintext highlighter-rouge">Hash#inspect</code> rendering has changed. [<a href="https://bugs.ruby-lang.org/issues/20433">Bug #20433</a>] <ul> <li>Symbol keys are displayed using the modern symbol key syntax: <code class="language-plaintext highlighter-rouge">"{user: 1}"</code></li> <li>Other keys now have spaces around <code class="language-plaintext highlighter-rouge">=&gt;</code>: <code class="language-plaintext highlighter-rouge">'{"user" =&gt; 1}'</code>, while previously they didn’t: <code class="language-plaintext highlighter-rouge">'{"user"=&gt;1}'</code></li> </ul> </li> </ul> <h2>C API updates</h2> <ul> <li><code class="language-plaintext highlighter-rouge">rb_newobj</code> and <code class="language-plaintext highlighter-rouge">rb_newobj_of</code> (and corresponding macros <code class="language-plaintext highlighter-rouge">RB_NEWOBJ</code>, <code class="language-plaintext highlighter-rouge">RB_NEWOBJ_OF</code>, <code class="language-plaintext highlighter-rouge">NEWOBJ</code>, <code class="language-plaintext highlighter-rouge">NEWOBJ_OF</code>) have been removed. [<a href="https://bugs.ruby-lang.org/issues/20265">Feature #20265</a>]</li> <li>Removed deprecated function <code class="language-plaintext highlighter-rouge">rb_gc_force_recycle</code>. [<a href="https://bugs.ruby-lang.org/issues/18290">Feature #18290</a>]</li> </ul> <h2>Implementation improvements</h2> <ul> <li><code class="language-plaintext highlighter-rouge">Array#each</code> is rewritten in Ruby for better performance [<a href="https://bugs.ruby-lang.org/issues/20182">Feature #20182</a>].</li> </ul> <h2>Miscellaneous changes</h2> <ul> <li> <p>Passing a block to a method which doesn’t use the passed block will show a warning on verbose mode (<code class="language-plaintext highlighter-rouge">-w</code>). [<a href="https://bugs.ruby-lang.org/issues/15554">Feature #15554</a>]</p> </li> <li> <p>Redefining some core methods that are specially optimized by the interpeter and JIT like <code class="language-plaintext highlighter-rouge">String.freeze</code> or <code class="language-plaintext highlighter-rouge">Integer#+</code> now emits a performance class warning (<code class="language-plaintext highlighter-rouge">-W:performance</code> or <code class="language-plaintext highlighter-rouge">Warning[:performance] = true</code>). [<a href="https://bugs.ruby-lang.org/issues/20429">Feature #20429</a>]</p> </li> </ul> <p>See GitHub releases like <a href="https://github.com/ruby/logger/releases">Logger</a> or changelog for details of the default gems or bundled gems.</p> <p>See <a href="https://github.com/ruby/ruby/blob/v3_4_0_preview2/NEWS.md">NEWS</a> or <a href="https://github.com/ruby/ruby/compare/v3_3_0...v3_4_0_preview2">commit logs</a> for more details.</p> <p>With those changes, <a href="https://github.com/ruby/ruby/compare/v3_3_0...v3_4_0_preview2#file_bucket">4422 files changed, 163889 insertions(+), 243380 deletions(-)</a> since Ruby 3.3.0!</p> <h2>Download</h2> <ul> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.gz">https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.gz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 22722332 SHA1: c23265acf6c07b4c1df1e41eebf8b4cf2f25b97b SHA256: 443cd7ec54ade4786bc974ce9f5d49f172a60f8edc84b597b7fe2bd2a94b8371 SHA512: 0946d256587597bdf13437a50f7a3298c151133edea161a1c4806a04dcbd8c2e8a7fd617f3eda16c5c05f6e6346317562cc30ba67698f1fdd92237c03bdbd23e </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.xz">https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.xz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 16878876 SHA1: dbff404b969012702dc500cac72f4d6b3822068e SHA256: 626bf4fe952323c15ec9a8999f470ec136ef91c0fc34c484646aaaa9a0b62ca7 SHA512: f23257896a35d3a581cbf5e8c94fe28e45725e39608a7669f47f31085338b1b4929a4db40d826d8fee628afb97b0c25b2f9e7bda4cd42e80c1208c46caf54265 </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.zip">https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.zip</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 28101194 SHA1: 479bd223bca3225fb3a15984e3eae4efb9a40189 SHA256: e00a6fbf6f9e25a725711a8aac7e38be6bed61de4db9862a405172b96bf38b5b SHA512: 0d9ee1c41920e4d594b0f2c40d02339b4e9a2cd5232f5ee914cab5a685cb4a2279fbbfd8fbad40ef0a53866db4e1de96068c62580ede6d8fab02550393bcbe81 </code></pre></div> </div> </li> </ul> <h2>What is Ruby</h2> <p>Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, and is now developed as Open Source. It runs on multiple platforms and is used all over the world especially for web development.</p> </div> </div> <hr class="hidden-modern" /> <div id="sidebar-wrapper"> <div id="sidebar"> <div class="navigation"> <h3><strong>Recent News</strong></h3> <ul class="menu"> <li><a href="/en/news/2024/11/05/ruby-3-3-6-released/">Ruby 3.3.6 Released</a></li> <li><a href="/en/news/2024/10/30/ruby-3-2-6-released/">Ruby 3.2.6 Released</a></li> <li><a href="/en/news/2024/10/28/redos-rexml-cve-2024-49761/">CVE-2024-49761: ReDoS vulnerability in REXML</a></li> <li><a href="/en/news/2024/10/07/ruby-3-4-0-preview2-released/">Ruby 3.4.0 preview2 Released</a></li> <li><a href="/en/news/2024/09/03/3-3-5-released/">Ruby 3.3.5 Released</a></li> </ul> </div> <h3>Syndicate</h3> <p><a href="/en/feeds/news.rss">Recent News (RSS)</a></p> </div> </div> <hr class="hidden-modern" /> </div> </div> </div> <div class="container"> <div id="footer"> <div class="site-links"> <a href="/en/" class="home">Home</a> <a href="/en/downloads/">Downloads</a> <a href="/en/documentation/">Documentation</a> <a href="/en/libraries/">Libraries</a> <a href="/en/community/">Community</a> <a href="/en/news/">News</a> <a href="/en/security/">Security</a> <a href="/en/about/">About Ruby</a> </div> <p> This site in other languages: <a href="/bg/">Български</a>, <a href="/de/">Deutsch</a>, <a href="/en/">English</a>, <a href="/es/">Español</a>, <a href="/fr/">Français</a>, <a href="/id/">Bahasa Indonesia</a>, <a href="/it/">Italiano</a>, <a href="/ja/">日本語</a>, <a href="/ko/">한국어</a>, <a href="/pl/">polski</a>, <a href="/pt/">Português</a>, <a href="/ru/">Русский</a>, <a href="/tr/">Türkçe</a>, <a href="/vi/">Tiếng Việt</a>, <a href="/zh_cn/">简体中文</a>, <a href="/zh_tw/">繁體中文</a>. </p> <p><a href="/en/about/website/">This website</a> is proudly maintained by members of the Ruby community.</p> </div> </div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10