♊️ GemiNews 🗞️
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
<p>We are pleased to announce the release of Ruby 3.3.0. Ruby 3.3 adds a new parser named Prism, uses Lrama as a parser generator, adds a new pure-Ruby JIT compiler named RJIT, and many performance improvements especially YJIT.</p> <h2>Prism</h2> <ul> <li>Introduced <a href="https://github.com/ruby/prism">the Prism parser</a> as a default gem <ul> <li>Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language</li> </ul> </li> <li>Prism is production ready and actively maintained, you can use it in place of Ripper <ul> <li>There is <a href="https://ruby.github.io/prism/">extensive documentation</a> on how to use Prism</li> <li>Prism is both a C library that will be used internally by CRuby and a Ruby gem that can be used by any tooling which needs to parse Ruby code</li> <li>Notable methods in the Prism API are: <ul> <li><code class="language-plaintext highlighter-rouge">Prism.parse(source)</code> which returns the AST as part of a parse result object</li> <li><code class="language-plaintext highlighter-rouge">Prism.parse_comments(source)</code> which returns the comments</li> <li><code class="language-plaintext highlighter-rouge">Prism.parse_success?(source)</code> which returns true if there are no errors</li> </ul> </li> </ul> </li> <li>You can make pull requests or issues directly on <a href="https://github.com/ruby/prism">the Prism repository</a> if you are interested in contributing</li> <li>You can now use <code class="language-plaintext highlighter-rouge">ruby --parser=prism</code> or <code class="language-plaintext highlighter-rouge">RUBYOPT="--parser=prism"</code> to experiment with the Prism compiler. Please note that this flag is for debugging only.</li> </ul> <h2>Use Lrama instead of Bison</h2> <ul> <li>Replace Bison with <a href="https://github.com/ruby/lrama">Lrama LALR parser generator</a> <a href="https://bugs.ruby-lang.org/issues/19637">[Feature #19637]</a> <ul> <li>If you have interest, please see <a href="https://rubykaigi.org/2023/presentations/spikeolaf.html">The future vision of Ruby Parser</a></li> <li>Lrama internal parser is replaced with LR parser generated by Racc for maintainability</li> <li>Parameterizing Rules <code class="language-plaintext highlighter-rouge">(?, *, +)</code> are supported, it will be used in Ruby parse.y</li> </ul> </li> </ul> <h2>YJIT</h2> <ul> <li>Major performance improvements over Ruby 3.2 <ul> <li>Support for splat and rest arguments has been improved.</li> <li>Registers are allocated for stack operations of the virtual machine.</li> <li>More calls with optional arguments are compiled. Exception handlers are also compiled.</li> <li>Unsupported call types and megamorphic call sites no longer exit to the interpreter.</li> <li>Basic methods like Rails <code class="language-plaintext highlighter-rouge">#blank?</code> and <a href="https://github.com/rails/rails/pull/49909">specialized <code class="language-plaintext highlighter-rouge">#present?</code></a> are inlined.</li> <li><code class="language-plaintext highlighter-rouge">Integer#*</code>, <code class="language-plaintext highlighter-rouge">Integer#!=</code>, <code class="language-plaintext highlighter-rouge">String#!=</code>, <code class="language-plaintext highlighter-rouge">String#getbyte</code>, <code class="language-plaintext highlighter-rouge">Kernel#block_given?</code>, <code class="language-plaintext highlighter-rouge">Kernel#is_a?</code>, <code class="language-plaintext highlighter-rouge">Kernel#instance_of?</code>, and <code class="language-plaintext highlighter-rouge">Module#===</code> are specially optimized.</li> <li>Compilation speed is now slightly faster than Ruby 3.2.</li> <li>Now more than 3x faster than the interpreter on Optcarrot!</li> </ul> </li> <li>Significantly improved memory usage over Ruby 3.2 <ul> <li>Metadata for compiled code uses a lot less memory.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-call-threshold</code> is automatically raised from 30 to 120 when the application has more than 40,000 ISEQs.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-cold-threshold</code> is added to skip compiling cold ISEQs.</li> <li>More compact code is generated on Arm64.</li> </ul> </li> <li>Code GC is now disabled by default <ul> <li><code class="language-plaintext highlighter-rouge">--yjit-exec-mem-size</code> is treated as a hard limit where compilation of new code stops.</li> <li>No sudden drops in performance due to code GC. Better copy-on-write behavior on servers reforking with <a href="https://github.com/shopify/pitchfork">Pitchfork</a>.</li> <li>You can still enable code GC if desired with <code class="language-plaintext highlighter-rouge">--yjit-code-gc</code></li> </ul> </li> <li>Add <code class="language-plaintext highlighter-rouge">RubyVM::YJIT.enable</code> that can enable YJIT at run-time <ul> <li>You can start YJIT without modifying command-line arguments or environment variables. Rails 7.2 will <a href="https://github.com/rails/rails/pull/49947">enable YJIT by default</a> using this method.</li> <li>This can also be used to enable YJIT only once your application is done booting. <code class="language-plaintext highlighter-rouge">--yjit-disable</code> can be used if you want to use other YJIT options while disabling YJIT at boot.</li> </ul> </li> <li>More YJIT stats are available by default <ul> <li><code class="language-plaintext highlighter-rouge">yjit_alloc_size</code> and several more metadata-related stats are now available by default.</li> <li><code class="language-plaintext highlighter-rouge">ratio_in_yjit</code> stat produced by <code class="language-plaintext highlighter-rouge">--yjit-stats</code> is now available in release builds, a special stats or dev build is no longer required to access most stats.</li> </ul> </li> <li>Add more profiling capabilities <ul> <li><code class="language-plaintext highlighter-rouge">--yjit-perf</code> is added to facilitate profiling with Linux perf.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-trace-exits</code> now supports sampling with <code class="language-plaintext highlighter-rouge">--yjit-trace-exits-sample-rate=N</code></li> </ul> </li> <li>More thorough testing and multiple bug fixes</li> </ul> <h2>RJIT</h2> <ul> <li>Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT. <ul> <li>RJIT supports only x86-64 architecture on Unix platforms.</li> <li>Unlike MJIT, it doesn’t require a C compiler at runtime.</li> </ul> </li> <li>RJIT exists only for experimental purposes. <ul> <li>You should keep using YJIT in production.</li> </ul> </li> <li>If you are interested in developing JIT for Ruby, please check out <a href="https://rubykaigi.org/2023/presentations/k0kubun.html#day3">k0kubun’s presentation on Day 3 of RubyKaigi</a>.</li> </ul> <h2>M:N thread scheduler</h2> <ul> <li>M:N thread scheduler was introduced. <a href="https://bugs.ruby-lang.org/issues/19842">[Feature #19842]</a> <ul> <li>M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced.</li> <li>It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default. <ul> <li><code class="language-plaintext highlighter-rouge">RUBY_MN_THREADS=1</code> environment variable enables M:N threads on the main Ractor.</li> <li>M:N threads are always enabled on non-main Ractors.</li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">RUBY_MAX_CPU=n</code> environment variable sets maximum number of <code class="language-plaintext highlighter-rouge">N</code> (maximum number of native threads). The default value is 8. <ul> <li>Since only one Ruby thread per Ractor can run at the same time, the number of native threads will be used, which is the smaller of the number specified in <code class="language-plaintext highlighter-rouge">RUBY_MAX_CPU</code> and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread.</li> <li>To support blocking operations, more than <code class="language-plaintext highlighter-rouge">N</code> native threads can be used.</li> </ul> </li> </ul> </li> </ul> <h2>Performance improvements</h2> <ul> <li><code class="language-plaintext highlighter-rouge">defined?(@ivar)</code> is optimized with Object Shapes.</li> <li>Name resolution such as <code class="language-plaintext highlighter-rouge">Socket.getaddrinfo</code> can now be interrupted (in environments where pthreads are available). <a href="https://bugs.ruby-lang.org/issues/19965">[Feature #19965]</a></li> <li>Several performance improvements to the Garbage Collector <ul> <li>Young objects referenced by old objects are no longer immediately promoted to the old generation. This significantly reduces the frequency of major GC collections. <a href="https://bugs.ruby-lang.org/issues/19678">[Feature #19678]</a></li> <li>A new <code class="language-plaintext highlighter-rouge">REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO</code> tuning variable was introduced to control the number of unprotected objects cause a major GC collection to trigger. The default is set to <code class="language-plaintext highlighter-rouge">0.01</code> (1%). This significantly reduces the frequency of major GC collection. <a href="https://bugs.ruby-lang.org/issues/19571">[Feature #19571]</a></li> <li>Write Barriers were implemented for many core types that were missing them, notably <code class="language-plaintext highlighter-rouge">Time</code>, <code class="language-plaintext highlighter-rouge">Enumerator</code>, <code class="language-plaintext highlighter-rouge">MatchData</code>, <code class="language-plaintext highlighter-rouge">Method</code>, <code class="language-plaintext highlighter-rouge">File::Stat</code>, <code class="language-plaintext highlighter-rouge">BigDecimal</code> and several others. This significantly reduces minor GC collection time and major GC collection frequency.</li> <li>Most core classes are now using Variable Width Allocation, notably <code class="language-plaintext highlighter-rouge">Hash</code>, <code class="language-plaintext highlighter-rouge">Time</code>, <code class="language-plaintext highlighter-rouge">Thread::Backtrace</code>, <code class="language-plaintext highlighter-rouge">Thread::Backtrace::Location</code>, <code class="language-plaintext highlighter-rouge">File::Stat</code>, <code class="language-plaintext highlighter-rouge">Method</code>. This makes these classes faster to allocate and free, use less memory and reduce heap fragmentation.</li> <li>Support for weak references has been added to the garbage collector. <a href="https://bugs.ruby-lang.org/issues/19783">[Feature #19783]</a></li> </ul> </li> </ul> <h2>Other notable changes since 3.2</h2> <h3>IRB</h3> <p>IRB has received several enhancements, including but not limited to:</p> <ul> <li>Advanced <code class="language-plaintext highlighter-rouge">irb:rdbg</code> integration that provides an equivalent debugging experience to <code class="language-plaintext highlighter-rouge">pry-byebug</code> (<a href="https://github.com/ruby/irb#debugging-with-irb">doc</a>).</li> <li>Pager support for <code class="language-plaintext highlighter-rouge">ls</code>, <code class="language-plaintext highlighter-rouge">show_source</code> and <code class="language-plaintext highlighter-rouge">show_cmds</code> commands.</li> <li>More accurate and helpful information provided by the <code class="language-plaintext highlighter-rouge">ls</code> and <code class="language-plaintext highlighter-rouge">show_source</code> commands.</li> <li>Experimental autocompletion using type analysis (<a href="https://github.com/ruby/irb#type-based-completion">doc</a>).</li> <li>It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (<a href="https://github.com/ruby/ruby/blob/master/doc/reline/face.md">doc</a>)</li> </ul> <p>In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.</p> <p>For more detailed updates, please refer to <a href="https://railsatscale.com/2023-12-19-irb-for-ruby-3-3/">Unveiling the big leap in Ruby 3.3’s IRB</a>.</p> <h2>Compatibility issues</h2> <p>Note: Excluding feature bug fixes.</p> <ul> <li><code class="language-plaintext highlighter-rouge">it</code> calls without arguments in a block with no ordinary parameters are deprecated. <code class="language-plaintext highlighter-rouge">it</code> will be a reference to the first block parameter in Ruby 3.4. <a href="https://bugs.ruby-lang.org/issues/18980">[Feature #18980]</a></li> </ul> <h3>Removed environment variables</h3> <p>The following deprecated methods are removed.</p> <ul> <li>Environment variable <code class="language-plaintext highlighter-rouge">RUBY_GC_HEAP_INIT_SLOTS</code> has been deprecated and is a no-op. Please use environment variables <code class="language-plaintext highlighter-rouge">RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS</code> instead. <a href="https://bugs.ruby-lang.org/issues/19785">[Feature #19785]</a></li> </ul> <h2>Stdlib compatibility issues</h2> <h3><code class="language-plaintext highlighter-rouge">ext/readline</code> is retired</h3> <ul> <li>We have <code class="language-plaintext highlighter-rouge">reline</code> that is pure Ruby implementation compatible with <code class="language-plaintext highlighter-rouge">ext/readline</code> API. We rely on <code class="language-plaintext highlighter-rouge">reline</code> in the future. If you need to use <code class="language-plaintext highlighter-rouge">ext/readline</code>, you can install <code class="language-plaintext highlighter-rouge">ext/readline</code> via rubygems.org with <code class="language-plaintext highlighter-rouge">gem install readline-ext</code>.</li> <li>We no longer need to install libraries like <code class="language-plaintext highlighter-rouge">libreadline</code> or <code class="language-plaintext highlighter-rouge">libedit</code>.</li> </ul> <h2>Standard library updates</h2> <p>RubyGems and Bundler warn if users do <code class="language-plaintext highlighter-rouge">require</code> the following gems without adding them to Gemfile or gemspec. This is because they will become the bundled gems in the future version of Ruby.</p> <p>This warning is suppressed if you use bootsnap gem. We recommend to run your application with <code class="language-plaintext highlighter-rouge">DISABLE_BOOTSNAP=1</code> environment variable at least once. This is limitation of this version.</p> <p>Targeted libraries are:</p> <ul> <li>abbrev</li> <li>base64</li> <li>bigdecimal</li> <li>csv</li> <li>drb</li> <li>getoptlong</li> <li>mutex_m</li> <li>nkf</li> <li>observer</li> <li>racc</li> <li>resolv-replace</li> <li>rinda</li> <li>syslog</li> </ul> <p>The following default gem is added.</p> <ul> <li>prism 0.19.0</li> </ul> <p>The following default gems are updated.</p> <ul> <li>RubyGems 3.5.3</li> <li>abbrev 0.1.2</li> <li>base64 0.2.0</li> <li>benchmark 0.3.0</li> <li>bigdecimal 3.1.5</li> <li>bundler 2.5.3</li> <li>cgi 0.4.1</li> <li>csv 3.2.8</li> <li>date 3.3.4</li> <li>delegate 0.3.1</li> <li>drb 2.2.0</li> <li>english 0.8.0</li> <li>erb 4.0.3</li> <li>error_highlight 0.6.0</li> <li>etc 1.4.3</li> <li>fcntl 1.1.0</li> <li>fiddle 1.1.2</li> <li>fileutils 1.7.2</li> <li>find 0.2.0</li> <li>getoptlong 0.2.1</li> <li>io-console 0.7.1</li> <li>io-nonblock 0.3.0</li> <li>io-wait 0.3.1</li> <li>ipaddr 1.2.6</li> <li>irb 1.11.0</li> <li>json 2.7.1</li> <li>logger 1.6.0</li> <li>mutex_m 0.2.0</li> <li>net-http 0.4.0</li> <li>net-protocol 0.2.2</li> <li>nkf 0.1.3</li> <li>observer 0.1.2</li> <li>open-uri 0.4.1</li> <li>open3 0.2.1</li> <li>openssl 3.2.0</li> <li>optparse 0.4.0</li> <li>ostruct 0.6.0</li> <li>pathname 0.3.0</li> <li>pp 0.5.0</li> <li>prettyprint 0.2.0</li> <li>pstore 0.1.3</li> <li>psych 5.1.2</li> <li>rdoc 6.6.2</li> <li>readline 0.0.4</li> <li>reline 0.4.1</li> <li>resolv 0.3.0</li> <li>rinda 0.2.0</li> <li>securerandom 0.3.1</li> <li>set 1.1.0</li> <li>shellwords 0.2.0</li> <li>singleton 0.2.0</li> <li>stringio 3.1.0</li> <li>strscan 3.0.7</li> <li>syntax_suggest 2.0.0</li> <li>syslog 0.1.2</li> <li>tempfile 0.2.1</li> <li>time 0.3.0</li> <li>timeout 0.4.1</li> <li>tmpdir 0.2.0</li> <li>tsort 0.2.0</li> <li>un 0.3.0</li> <li>uri 0.13.0</li> <li>weakref 0.1.3</li> <li>win32ole 1.8.10</li> <li>yaml 0.3.0</li> <li>zlib 3.1.0</li> </ul> <p>The following bundled gem is promoted from default gems.</p> <ul> <li>racc 1.7.3</li> </ul> <p>The following bundled gems are updated.</p> <ul> <li>minitest 5.20.0</li> <li>rake 13.1.0</li> <li>test-unit 3.6.1</li> <li>rexml 3.2.6</li> <li>rss 0.3.0</li> <li>net-ftp 0.3.3</li> <li>net-imap 0.4.9</li> <li>net-smtp 0.4.0</li> <li>rbs 3.4.0</li> <li>typeprof 0.21.9</li> <li>debug 1.9.1</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_3_0/NEWS.md">NEWS</a> or <a href="https://github.com/ruby/ruby/compare/v3_2_0...v3_3_0">commit logs</a> for more details.</p> <p>With those changes, <a href="https://github.com/ruby/ruby/compare/v3_2_0...v3_3_0#file_bucket">5532 files changed, 326851 insertions(+), 185793 deletions(-)</a> since Ruby 3.2.0!</p> <p>Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3!</p> <h2>Download</h2> <ul> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 22065999 SHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b SHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d SHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6 </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 16345456 SHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6 SHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b SHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01 </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 26935108 SHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1 SHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8 SHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450 </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> <p>Posted by naruse on 25 Dec 2023</p>
Content
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::RSSEntry published: 2023-12-25 00:00:00.000000000 Z carlessian_info: news_filer_version: 2 newspaper: Ruby (EN RSS) macro_region: Technology entry_id: !ruby/object:Feedjira::Parser::GloballyUniqueIdentifier guid: https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/ title: Ruby 3.3.0 Released categories: [] summary: |2- <p>We are pleased to announce the release of Ruby 3.3.0. Ruby 3.3 adds a new parser named Prism, uses Lrama as a parser generator, adds a new pure-Ruby JIT compiler named RJIT, and many performance improvements especially YJIT.</p> <h2>Prism</h2> <ul> <li>Introduced <a href="https://github.com/ruby/prism">the Prism parser</a> as a default gem <ul> <li>Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language</li> </ul> </li> <li>Prism is production ready and actively maintained, you can use it in place of Ripper <ul> <li>There is <a href="https://ruby.github.io/prism/">extensive documentation</a> on how to use Prism</li> <li>Prism is both a C library that will be used internally by CRuby and a Ruby gem that can be used by any tooling which needs to parse Ruby code</li> <li>Notable methods in the Prism API are: <ul> <li><code class="language-plaintext highlighter-rouge">Prism.parse(source)</code> which returns the AST as part of a parse result object</li> <li><code class="language-plaintext highlighter-rouge">Prism.parse_comments(source)</code> which returns the comments</li> <li><code class="language-plaintext highlighter-rouge">Prism.parse_success?(source)</code> which returns true if there are no errors</li> </ul> </li> </ul> </li> <li>You can make pull requests or issues directly on <a href="https://github.com/ruby/prism">the Prism repository</a> if you are interested in contributing</li> <li>You can now use <code class="language-plaintext highlighter-rouge">ruby --parser=prism</code> or <code class="language-plaintext highlighter-rouge">RUBYOPT="--parser=prism"</code> to experiment with the Prism compiler. Please note that this flag is for debugging only.</li> </ul> <h2>Use Lrama instead of Bison</h2> <ul> <li>Replace Bison with <a href="https://github.com/ruby/lrama">Lrama LALR parser generator</a> <a href="https://bugs.ruby-lang.org/issues/19637">[Feature #19637]</a> <ul> <li>If you have interest, please see <a href="https://rubykaigi.org/2023/presentations/spikeolaf.html">The future vision of Ruby Parser</a></li> <li>Lrama internal parser is replaced with LR parser generated by Racc for maintainability</li> <li>Parameterizing Rules <code class="language-plaintext highlighter-rouge">(?, *, +)</code> are supported, it will be used in Ruby parse.y</li> </ul> </li> </ul> <h2>YJIT</h2> <ul> <li>Major performance improvements over Ruby 3.2 <ul> <li>Support for splat and rest arguments has been improved.</li> <li>Registers are allocated for stack operations of the virtual machine.</li> <li>More calls with optional arguments are compiled. Exception handlers are also compiled.</li> <li>Unsupported call types and megamorphic call sites no longer exit to the interpreter.</li> <li>Basic methods like Rails <code class="language-plaintext highlighter-rouge">#blank?</code> and <a href="https://github.com/rails/rails/pull/49909">specialized <code class="language-plaintext highlighter-rouge">#present?</code></a> are inlined.</li> <li><code class="language-plaintext highlighter-rouge">Integer#*</code>, <code class="language-plaintext highlighter-rouge">Integer#!=</code>, <code class="language-plaintext highlighter-rouge">String#!=</code>, <code class="language-plaintext highlighter-rouge">String#getbyte</code>, <code class="language-plaintext highlighter-rouge">Kernel#block_given?</code>, <code class="language-plaintext highlighter-rouge">Kernel#is_a?</code>, <code class="language-plaintext highlighter-rouge">Kernel#instance_of?</code>, and <code class="language-plaintext highlighter-rouge">Module#===</code> are specially optimized.</li> <li>Compilation speed is now slightly faster than Ruby 3.2.</li> <li>Now more than 3x faster than the interpreter on Optcarrot!</li> </ul> </li> <li>Significantly improved memory usage over Ruby 3.2 <ul> <li>Metadata for compiled code uses a lot less memory.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-call-threshold</code> is automatically raised from 30 to 120 when the application has more than 40,000 ISEQs.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-cold-threshold</code> is added to skip compiling cold ISEQs.</li> <li>More compact code is generated on Arm64.</li> </ul> </li> <li>Code GC is now disabled by default <ul> <li><code class="language-plaintext highlighter-rouge">--yjit-exec-mem-size</code> is treated as a hard limit where compilation of new code stops.</li> <li>No sudden drops in performance due to code GC. Better copy-on-write behavior on servers reforking with <a href="https://github.com/shopify/pitchfork">Pitchfork</a>.</li> <li>You can still enable code GC if desired with <code class="language-plaintext highlighter-rouge">--yjit-code-gc</code></li> </ul> </li> <li>Add <code class="language-plaintext highlighter-rouge">RubyVM::YJIT.enable</code> that can enable YJIT at run-time <ul> <li>You can start YJIT without modifying command-line arguments or environment variables. Rails 7.2 will <a href="https://github.com/rails/rails/pull/49947">enable YJIT by default</a> using this method.</li> <li>This can also be used to enable YJIT only once your application is done booting. <code class="language-plaintext highlighter-rouge">--yjit-disable</code> can be used if you want to use other YJIT options while disabling YJIT at boot.</li> </ul> </li> <li>More YJIT stats are available by default <ul> <li><code class="language-plaintext highlighter-rouge">yjit_alloc_size</code> and several more metadata-related stats are now available by default.</li> <li><code class="language-plaintext highlighter-rouge">ratio_in_yjit</code> stat produced by <code class="language-plaintext highlighter-rouge">--yjit-stats</code> is now available in release builds, a special stats or dev build is no longer required to access most stats.</li> </ul> </li> <li>Add more profiling capabilities <ul> <li><code class="language-plaintext highlighter-rouge">--yjit-perf</code> is added to facilitate profiling with Linux perf.</li> <li><code class="language-plaintext highlighter-rouge">--yjit-trace-exits</code> now supports sampling with <code class="language-plaintext highlighter-rouge">--yjit-trace-exits-sample-rate=N</code></li> </ul> </li> <li>More thorough testing and multiple bug fixes</li> </ul> <h2>RJIT</h2> <ul> <li>Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT. <ul> <li>RJIT supports only x86-64 architecture on Unix platforms.</li> <li>Unlike MJIT, it doesn’t require a C compiler at runtime.</li> </ul> </li> <li>RJIT exists only for experimental purposes. <ul> <li>You should keep using YJIT in production.</li> </ul> </li> <li>If you are interested in developing JIT for Ruby, please check out <a href="https://rubykaigi.org/2023/presentations/k0kubun.html#day3">k0kubun’s presentation on Day 3 of RubyKaigi</a>.</li> </ul> <h2>M:N thread scheduler</h2> <ul> <li>M:N thread scheduler was introduced. <a href="https://bugs.ruby-lang.org/issues/19842">[Feature #19842]</a> <ul> <li>M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced.</li> <li>It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default. <ul> <li><code class="language-plaintext highlighter-rouge">RUBY_MN_THREADS=1</code> environment variable enables M:N threads on the main Ractor.</li> <li>M:N threads are always enabled on non-main Ractors.</li> </ul> </li> <li><code class="language-plaintext highlighter-rouge">RUBY_MAX_CPU=n</code> environment variable sets maximum number of <code class="language-plaintext highlighter-rouge">N</code> (maximum number of native threads). The default value is 8. <ul> <li>Since only one Ruby thread per Ractor can run at the same time, the number of native threads will be used, which is the smaller of the number specified in <code class="language-plaintext highlighter-rouge">RUBY_MAX_CPU</code> and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread.</li> <li>To support blocking operations, more than <code class="language-plaintext highlighter-rouge">N</code> native threads can be used.</li> </ul> </li> </ul> </li> </ul> <h2>Performance improvements</h2> <ul> <li><code class="language-plaintext highlighter-rouge">defined?(@ivar)</code> is optimized with Object Shapes.</li> <li>Name resolution such as <code class="language-plaintext highlighter-rouge">Socket.getaddrinfo</code> can now be interrupted (in environments where pthreads are available). <a href="https://bugs.ruby-lang.org/issues/19965">[Feature #19965]</a></li> <li>Several performance improvements to the Garbage Collector <ul> <li>Young objects referenced by old objects are no longer immediately promoted to the old generation. This significantly reduces the frequency of major GC collections. <a href="https://bugs.ruby-lang.org/issues/19678">[Feature #19678]</a></li> <li>A new <code class="language-plaintext highlighter-rouge">REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO</code> tuning variable was introduced to control the number of unprotected objects cause a major GC collection to trigger. The default is set to <code class="language-plaintext highlighter-rouge">0.01</code> (1%). This significantly reduces the frequency of major GC collection. <a href="https://bugs.ruby-lang.org/issues/19571">[Feature #19571]</a></li> <li>Write Barriers were implemented for many core types that were missing them, notably <code class="language-plaintext highlighter-rouge">Time</code>, <code class="language-plaintext highlighter-rouge">Enumerator</code>, <code class="language-plaintext highlighter-rouge">MatchData</code>, <code class="language-plaintext highlighter-rouge">Method</code>, <code class="language-plaintext highlighter-rouge">File::Stat</code>, <code class="language-plaintext highlighter-rouge">BigDecimal</code> and several others. This significantly reduces minor GC collection time and major GC collection frequency.</li> <li>Most core classes are now using Variable Width Allocation, notably <code class="language-plaintext highlighter-rouge">Hash</code>, <code class="language-plaintext highlighter-rouge">Time</code>, <code class="language-plaintext highlighter-rouge">Thread::Backtrace</code>, <code class="language-plaintext highlighter-rouge">Thread::Backtrace::Location</code>, <code class="language-plaintext highlighter-rouge">File::Stat</code>, <code class="language-plaintext highlighter-rouge">Method</code>. This makes these classes faster to allocate and free, use less memory and reduce heap fragmentation.</li> <li>Support for weak references has been added to the garbage collector. <a href="https://bugs.ruby-lang.org/issues/19783">[Feature #19783]</a></li> </ul> </li> </ul> <h2>Other notable changes since 3.2</h2> <h3>IRB</h3> <p>IRB has received several enhancements, including but not limited to:</p> <ul> <li>Advanced <code class="language-plaintext highlighter-rouge">irb:rdbg</code> integration that provides an equivalent debugging experience to <code class="language-plaintext highlighter-rouge">pry-byebug</code> (<a href="https://github.com/ruby/irb#debugging-with-irb">doc</a>).</li> <li>Pager support for <code class="language-plaintext highlighter-rouge">ls</code>, <code class="language-plaintext highlighter-rouge">show_source</code> and <code class="language-plaintext highlighter-rouge">show_cmds</code> commands.</li> <li>More accurate and helpful information provided by the <code class="language-plaintext highlighter-rouge">ls</code> and <code class="language-plaintext highlighter-rouge">show_source</code> commands.</li> <li>Experimental autocompletion using type analysis (<a href="https://github.com/ruby/irb#type-based-completion">doc</a>).</li> <li>It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (<a href="https://github.com/ruby/ruby/blob/master/doc/reline/face.md">doc</a>)</li> </ul> <p>In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.</p> <p>For more detailed updates, please refer to <a href="https://railsatscale.com/2023-12-19-irb-for-ruby-3-3/">Unveiling the big leap in Ruby 3.3’s IRB</a>.</p> <h2>Compatibility issues</h2> <p>Note: Excluding feature bug fixes.</p> <ul> <li><code class="language-plaintext highlighter-rouge">it</code> calls without arguments in a block with no ordinary parameters are deprecated. <code class="language-plaintext highlighter-rouge">it</code> will be a reference to the first block parameter in Ruby 3.4. <a href="https://bugs.ruby-lang.org/issues/18980">[Feature #18980]</a></li> </ul> <h3>Removed environment variables</h3> <p>The following deprecated methods are removed.</p> <ul> <li>Environment variable <code class="language-plaintext highlighter-rouge">RUBY_GC_HEAP_INIT_SLOTS</code> has been deprecated and is a no-op. Please use environment variables <code class="language-plaintext highlighter-rouge">RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS</code> instead. <a href="https://bugs.ruby-lang.org/issues/19785">[Feature #19785]</a></li> </ul> <h2>Stdlib compatibility issues</h2> <h3><code class="language-plaintext highlighter-rouge">ext/readline</code> is retired</h3> <ul> <li>We have <code class="language-plaintext highlighter-rouge">reline</code> that is pure Ruby implementation compatible with <code class="language-plaintext highlighter-rouge">ext/readline</code> API. We rely on <code class="language-plaintext highlighter-rouge">reline</code> in the future. If you need to use <code class="language-plaintext highlighter-rouge">ext/readline</code>, you can install <code class="language-plaintext highlighter-rouge">ext/readline</code> via rubygems.org with <code class="language-plaintext highlighter-rouge">gem install readline-ext</code>.</li> <li>We no longer need to install libraries like <code class="language-plaintext highlighter-rouge">libreadline</code> or <code class="language-plaintext highlighter-rouge">libedit</code>.</li> </ul> <h2>Standard library updates</h2> <p>RubyGems and Bundler warn if users do <code class="language-plaintext highlighter-rouge">require</code> the following gems without adding them to Gemfile or gemspec. This is because they will become the bundled gems in the future version of Ruby.</p> <p>This warning is suppressed if you use bootsnap gem. We recommend to run your application with <code class="language-plaintext highlighter-rouge">DISABLE_BOOTSNAP=1</code> environment variable at least once. This is limitation of this version.</p> <p>Targeted libraries are:</p> <ul> <li>abbrev</li> <li>base64</li> <li>bigdecimal</li> <li>csv</li> <li>drb</li> <li>getoptlong</li> <li>mutex_m</li> <li>nkf</li> <li>observer</li> <li>racc</li> <li>resolv-replace</li> <li>rinda</li> <li>syslog</li> </ul> <p>The following default gem is added.</p> <ul> <li>prism 0.19.0</li> </ul> <p>The following default gems are updated.</p> <ul> <li>RubyGems 3.5.3</li> <li>abbrev 0.1.2</li> <li>base64 0.2.0</li> <li>benchmark 0.3.0</li> <li>bigdecimal 3.1.5</li> <li>bundler 2.5.3</li> <li>cgi 0.4.1</li> <li>csv 3.2.8</li> <li>date 3.3.4</li> <li>delegate 0.3.1</li> <li>drb 2.2.0</li> <li>english 0.8.0</li> <li>erb 4.0.3</li> <li>error_highlight 0.6.0</li> <li>etc 1.4.3</li> <li>fcntl 1.1.0</li> <li>fiddle 1.1.2</li> <li>fileutils 1.7.2</li> <li>find 0.2.0</li> <li>getoptlong 0.2.1</li> <li>io-console 0.7.1</li> <li>io-nonblock 0.3.0</li> <li>io-wait 0.3.1</li> <li>ipaddr 1.2.6</li> <li>irb 1.11.0</li> <li>json 2.7.1</li> <li>logger 1.6.0</li> <li>mutex_m 0.2.0</li> <li>net-http 0.4.0</li> <li>net-protocol 0.2.2</li> <li>nkf 0.1.3</li> <li>observer 0.1.2</li> <li>open-uri 0.4.1</li> <li>open3 0.2.1</li> <li>openssl 3.2.0</li> <li>optparse 0.4.0</li> <li>ostruct 0.6.0</li> <li>pathname 0.3.0</li> <li>pp 0.5.0</li> <li>prettyprint 0.2.0</li> <li>pstore 0.1.3</li> <li>psych 5.1.2</li> <li>rdoc 6.6.2</li> <li>readline 0.0.4</li> <li>reline 0.4.1</li> <li>resolv 0.3.0</li> <li>rinda 0.2.0</li> <li>securerandom 0.3.1</li> <li>set 1.1.0</li> <li>shellwords 0.2.0</li> <li>singleton 0.2.0</li> <li>stringio 3.1.0</li> <li>strscan 3.0.7</li> <li>syntax_suggest 2.0.0</li> <li>syslog 0.1.2</li> <li>tempfile 0.2.1</li> <li>time 0.3.0</li> <li>timeout 0.4.1</li> <li>tmpdir 0.2.0</li> <li>tsort 0.2.0</li> <li>un 0.3.0</li> <li>uri 0.13.0</li> <li>weakref 0.1.3</li> <li>win32ole 1.8.10</li> <li>yaml 0.3.0</li> <li>zlib 3.1.0</li> </ul> <p>The following bundled gem is promoted from default gems.</p> <ul> <li>racc 1.7.3</li> </ul> <p>The following bundled gems are updated.</p> <ul> <li>minitest 5.20.0</li> <li>rake 13.1.0</li> <li>test-unit 3.6.1</li> <li>rexml 3.2.6</li> <li>rss 0.3.0</li> <li>net-ftp 0.3.3</li> <li>net-imap 0.4.9</li> <li>net-smtp 0.4.0</li> <li>rbs 3.4.0</li> <li>typeprof 0.21.9</li> <li>debug 1.9.1</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_3_0/NEWS.md">NEWS</a> or <a href="https://github.com/ruby/ruby/compare/v3_2_0...v3_3_0">commit logs</a> for more details.</p> <p>With those changes, <a href="https://github.com/ruby/ruby/compare/v3_2_0...v3_3_0#file_bucket">5532 files changed, 326851 insertions(+), 185793 deletions(-)</a> since Ruby 3.2.0!</p> <p>Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3!</p> <h2>Download</h2> <ul> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 22065999 SHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b SHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d SHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6 </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 16345456 SHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6 SHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b SHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01 </code></pre></div> </div> </li> <li> <p><a href="https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip">https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip</a></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>SIZE: 26935108 SHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1 SHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8 SHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450 </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> <p>Posted by naruse on 25 Dec 2023</p> rss_fields: - title - url - summary - published - entry_id url: https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-04-03 16:31:18 +0200. Content is EMPTY here. Entried: title,url,summary,published,entry_id. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Technology/Ruby (EN RSS)/2023-12-25-Ruby_3.3.0_Released-v2.yaml
Ricc source
Show this article
Back to articles