Posted by naruse on 25 Dec 2023
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.
PrismPrism.parse(source)
which returns the AST as part of a parse result objectPrism.parse_comments(source)
which returns the commentsPrism.parse_success?(source)
which returns true if there are no errorsruby --parser=prism
or RUBYOPT="--parser=prism"
to experiment with the Prism compiler. Please note that this flag is for debugging only.(?, *, +)
are supported, it will be used in Ruby parse.y#blank?
and specialized #present?
are inlined.Integer#*
, Integer#!=
, String#!=
, String#getbyte
, Kernel#block_given?
, Kernel#is_a?
, Kernel#instance_of?
, and Module#===
are specially optimized.--yjit-call-threshold
is automatically raised from 30 to 120 when the application has more than 40,000 ISEQs.--yjit-cold-threshold
is added to skip compiling cold ISEQs.--yjit-exec-mem-size
is treated as a hard limit where compilation of new code stops.--yjit-code-gc
RubyVM::YJIT.enable
that can enable YJIT at run-time
--yjit-disable
can be used if you want to use other YJIT options while disabling YJIT at boot.yjit_alloc_size
and several more metadata-related stats are now available by default.ratio_in_yjit
stat produced by --yjit-stats
is now available in release builds, a special stats or dev build is no longer required to access most stats.--yjit-perf
is added to facilitate profiling with Linux perf.--yjit-trace-exits
now supports sampling with --yjit-trace-exits-sample-rate=N
RUBY_MN_THREADS=1
environment variable enables M:N threads on the main Ractor.RUBY_MAX_CPU=n
environment variable sets maximum number of N
(maximum number of native threads). The default value is 8.
RUBY_MAX_CPU
and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread.N
native threads can be used.defined?(@ivar)
is optimized with Object Shapes.Socket.getaddrinfo
can now be interrupted (in environments where pthreads are available). [Feature #19965]REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO
tuning variable was introduced to control the number of unprotected objects cause a major GC collection to trigger. The default is set to 0.01
(1%). This significantly reduces the frequency of major GC collection. [Feature #19571]Time
, Enumerator
, MatchData
, Method
, File::Stat
, BigDecimal
and several others. This significantly reduces minor GC collection time and major GC collection frequency.Hash
, Time
, Thread::Backtrace
, Thread::Backtrace::Location
, File::Stat
, Method
. This makes these classes faster to allocate and free, use less memory and reduce heap fragmentation.IRB has received several enhancements, including but not limited to:
irb:rdbg
integration that provides an equivalent debugging experience to pry-byebug
(doc).ls
, show_source
and show_cmds
commands.ls
and show_source
commands.In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.
For more detailed updates, please refer to Unveiling the big leap in Ruby 3.3’s IRB.
Compatibility issuesNote: Excluding feature bug fixes.
it
calls without arguments in a block with no ordinary parameters are deprecated. it
will be a reference to the first block parameter in Ruby 3.4. [Feature #18980]
Regexp::new
now only accepts up to 2 arguments instead of 3. This was deprecated in Ruby 3.2. [Bug #18797]
The following deprecated methods are removed.
RUBY_GC_HEAP_INIT_SLOTS
has been deprecated and is a no-op. Please use environment variables RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS
instead. [Feature #19785]ext/readline
is retired
reline
that is pure Ruby implementation compatible with ext/readline
API. We rely on reline
in the future. If you need to use ext/readline
, you can install ext/readline
via rubygems.org with gem install readline-ext
.libreadline
or libedit
.RubyGems and Bundler warn if users do require
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.
This warning is suppressed if you use bootsnap gem. We recommend to run your application with DISABLE_BOOTSNAP=1
environment variable at least once. This is limitation of this version.
Targeted libraries are:
The following default gem is added.
The following default gems are updated.
The following bundled gem is promoted from default gems.
The following bundled gems are updated.
See GitHub releases like Logger or changelog for details of the default gems or bundled gems.
See NEWS or commit logs for more details.
With those changes, 5532 files changed, 326851 insertions(+), 185793 deletions(-) since Ruby 3.2.0!
Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3!
Downloadhttps://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
SIZE: 22065999
SHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b
SHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d
SHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6
https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz
SIZE: 16345456
SHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6
SHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b
SHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01
https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip
SIZE: 26935108
SHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1
SHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8
SHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450
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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3