Ruby 3.3.0-rc1 Released (2024)

Posted by naruse on 11 Dec 2023

We are pleased to announce the release of Ruby 3.3.0-rc1. 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.

After the release of RC1, we will avoid introducing ABI incompatibilities wherever possible. If we need to do, we’ll announce it in the release note.

Prism

  • Introduced the Prism parser as a default gem
    • Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language
  • Prism is production ready and actively maintained, you can use it in place of Ripper
    • There is extensive documentation on how to use Prism
    • 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
    • Notable methods in the Prism API are:
      • Prism.parse(source) which returns the AST as part of a ParseResult
      • Prism.dump(source) which returns the serialized AST as a String
      • Prism.parse_comments(source) which returns the comments
  • You can make pull requests or issues directly on the Prism repository if you are interested in contributing

Use Lrama instead of Bison

RJIT

  • Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT.
    • RJIT supports only x86-64 architecture on Unix platforms.
    • Unlike MJIT, it doesn’t require a C compiler at runtime.
  • RJIT exists only for experimental purposes.
    • You should keep using YJIT in production.
  • If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi.

YJIT

  • Major performance improvements over 3.2
    • Support for splat and rest arguments has been improved.
    • Registers are allocated for stack operations of the virtual machine.
    • More calls with optional arguments are compiled.
    • Exception handlers are also compiled.
    • Instance variables no longer exit to the interpreterwith megamorphic object shapes.
    • Unsupported call types no longer exit to the interpreter.
    • Integer#!=, String#!=, Kernel#block_given?, Kernel#is_a?,Kernel#instance_of?, Module#=== are specially optimized.
    • Now more than 3x faster than the interpreter on optcarrot!
  • Significantly improved memory usage over 3.2
    • Metadata for compiled code uses a lot less memory.
    • Generate more compact code on ARM64
  • Compilation speed is now slightly faster than 3.2.
  • Add RubyVM::YJIT.enable that can enable YJIT at run-time
    • You can start YJIT without modifying command-line arguments or environment variables.
    • This can also be used to enable YJIT only once your application isdone booting. --yjit-disable can be used if you want to use otherYJIT options while disabling YJIT at boot.
  • Code GC is now disabled by default, and --yjit-exec-mem-size is treatedas a hard limit where compilation of new code stops.
    • Better copy-on-write behavior on servers using unicorn and forking
    • No sudden drops in performance due to code GC.
    • You can still enable code GC if desired with --yjit-code-gc
  • 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.
  • Exit tracing option now supports sampling
    • --trace-exits-sample-rate=N
  • --yjit-perf is added to facilitate profiling with Linux perf.
  • More thorough testing and multiple bug fixes

M:N thread scheduler

  • M:N thread scheduler was introduced. [Feature #19842]
    • M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced.
    • It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default.
      • RUBY_MN_THREADS=1 environment variable enables M:N threads on the main Ractor.
      • M:N threads are enabled on non-main Ractors.
    • RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8.
      • 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 RUBY_MAX_CPU and the number of running Ractors. So that single Ractor applications (most of applications) will use 1 native thread.
      • To support blocking operations, more than N native threads can be used.

Other Notable New Features

Language

Performance improvements

  • defined?(@ivar) is optimized with Object Shapes.
  • Name resolution such as Socket.getaddrinfo can now be interrupted (in environments where pthreads are available). Feature #19965
    • For this purpose, a pthread is now created whenever calling getaddrinfo or getnameinfo. This incurs some overhead in name resolution (about 2.5x in our experiments). We do not expect the name resolution overhead to be a problem for most applications, but if you observe such, or if you see unexpected affects that you believe are due to this change, please report them.
  • Several performance improvements to the Garbage Collector
    • Young objects referenced by old objects are no longer immediately promoted to the old generation. This significantly reduces the frequency of major GC collections. [Feature #19678]
    • A new 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]
    • Write Barriers were implemented for many core types that were missing them, notably Time, Enumerator, MatchData, Method, File::Stat, BigDecimal and several others. This significantly reduces minor GC collection time and major GC collection frequency.
    • Most core classes are now using Variable Width Allocation, notably 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.
    • Support for weak references has been added to the garbage collector. [Feature #19783]

Other notable changes since 3.2

IRB

IRB has received several enhancements, including but not limited to:

  • Advanced irb:rdbg integration that provides an equivalent debugging experience to pry-byebug (doc).
  • Pager support for ls, show_source and show_cmds commands.
  • More accurate and helpful information provided by the ls and show_source commands.
  • Experimental autocompletion using type analysis (doc).
  • It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (doc)

In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.

Compatibility issues

Note: Excluding feature bug fixes.

  • it calls without arguments in a block with no ordinary parameters aredeprecated. it will be a reference to the first block parameter in Ruby 3.4.Feature #18980

Removed constants

The following deprecated constants are removed.

Removed methods

The following deprecated methods are removed.

Removed environment variables

The following deprecated environment variables are removed.

  • Environment variable 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

Stdlib compatibility issues

ext/readline is retired

  • We have 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.
  • We no longer need to install libraries like libreadline or libedit.

C API updates

Updated C APIs

The following APIs are updated.

Removed C APIs

The following deprecated APIs are removed.

Standard library updates

RubyGems and Bundler warn if users require gem that is scheduled to become the bundled gems in the future version of Ruby.

Targeted libraries are:

  • abbrev
  • base64
  • bigdecimal
  • csv
  • drb
  • getoptlong
  • mutex_m
  • nkf
  • observer
  • racc
  • resolv-replace
  • rinda
  • syslog

The following default gem is added.

  • prism 0.15.1

The following default gems are updated.

  • RubyGems 3.5.0.dev
  • base64 0.2.0
  • benchmark 0.3.0
  • bigdecimal 3.1.5
  • bundler 2.5.0.dev
  • cgi 0.4.0
  • csv 3.2.8
  • date 3.3.4
  • delegate 0.3.1
  • drb 2.2.0
  • english 0.8.0
  • erb 4.0.3
  • etc 1.4.3.dev.1
  • fcntl 1.1.0
  • fiddle 1.1.2
  • fileutils 1.7.2
  • find 0.2.0
  • getoptlong 0.2.1
  • io-console 0.6.1.dev
  • irb 1.8.3
  • logger 1.6.0
  • mutex_m 0.2.0
  • net-http 0.4.0
  • net-protocol 0.2.2
  • nkf 0.1.3
  • observer 0.1.2
  • open-uri 0.4.0
  • open3 0.2.0
  • openssl 3.2.0
  • optparse 0.4.0
  • ostruct 0.6.0
  • pathname 0.3.0
  • pp 0.5.0
  • prettyprint 0.2.0
  • pstore 0.1.3
  • psych 5.1.1.1
  • rdoc 6.6.0
  • reline 0.3.9
  • rinda 0.2.0
  • securerandom 0.3.0
  • shellwords 0.2.0
  • singleton 0.2.0
  • stringio 3.0.9
  • strscan 3.0.7
  • syntax_suggest 1.1.0
  • tempfile 0.2.0
  • time 0.3.0
  • timeout 0.4.1
  • tmpdir 0.2.0
  • tsort 0.2.0
  • un 0.3.0
  • uri 0.13.0
  • weakref 0.1.3
  • win32ole 1.8.10
  • yaml 0.3.0
  • zlib 3.1.0

The following bundled gem is promoted from default gems.

  • racc 1.7.3

The following bundled gems are updated.

  • minitest 5.20.0
  • rake 13.1.0
  • test-unit 3.6.1
  • rexml 3.2.6
  • rss 0.3.0
  • net-imap 0.4.4
  • net-smtp 0.4.0
  • rbs 3.2.2
  • typeprof 0.21.8
  • debug 1.8.0

See GitHub releases like Logger orchangelog for details of the default gems or bundled gems.

See NEWSor commit logsfor more details.

With those changes, 5414 files changed, 306141 insertions(+), 183575 deletions(-)since Ruby 3.2.0!

Download

  • https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0-rc1.tar.gz

    SIZE: 21783575SHA1: c75a860e06f27b7f69b874757417277c21d1d3f4SHA256: c4ff82395a90ef76c7f906b7687026e0ab96b094dcf3a532d9ab97784a073222SHA512: 265fb2ffe55af47d8349edffcebe749cc170291227cef55529fe4e67363e4e84b88daa34ffb5364a99c8a0e32110266a34c9a11d62f3bd6f6d47fa76eca641f4
  • https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0-rc1.tar.xz

    SIZE: 16163884SHA1: 26503f9bdc7d0a05aaa9836f54d3aa9e74a9ead9SHA256: 051815637f1fa75a1edf2c54b66d5d5b69563daad777da8dc39543b7754b5290SHA512: 82f4acfaad1dc47db27ee3eb952481a95b3474a98059e9e9f5ceb035b690d1faabe99f2ec52371c4089ed1615eb10c395f029088418fec4d26399b65b4f259b9
  • https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0-rc1.zip

    SIZE: 26735443SHA1: 35583453a7734216b08829ef0ec9ea1bc0d4ae7fSHA256: 56dd82e1dd714f2889ca975ae7befbe005675de08839c2cc4a484de2ae65201cSHA512: 7fbe414c230aedc9f364512bcbc213038f8f6e4268929a559d2527e2f3e32a140b394e37098ab7e59161236eca8b89cc9e52d73a3be8d7bd44faa91681483f5d

What is Ruby

Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993,and is now developed as Open Source. It runs on multiple platformsand is used all over the world especially for web development.

Ruby 3.3.0-rc1 Released (2024)

FAQs

What's the latest ruby version? ›

What is the latest Ruby version? Ruby 3.3 is the Ruby latest version (3.3. 0 was released Dec 25, 2023). Visit the Ruby releases page at the official Ruby website to check for a newer version.

How to change ruby version using asdf? ›

To override the default version of Ruby for a particular project, move into the project root directory and enter the command asdf local ruby <version> . The command will write a file . tool-versions file in the current directory containing a Ruby version number.

What is a ruby version file? ›

ruby-version file in the root directory of each app. The file specifies the required version of Ruby for the application and the manager automatically switches the environment to use the specified version.

What is the Ruby version using RVM? ›

Ruby Version Manager (RVM) is a utility that allows you to add your own personal version of Ruby to a user. It allows you to add, remove, or have multiple versions of Ruby and its libraries live in your user directory.

Is Ruby outdated? ›

Ruby on Rails is still alive and relevant in 2024 for web development. There is a strong community of Ruby on Rails developers supporting the framework.

What is the most stable version of Ruby? ›

As of May 2024, the highest stable Ruby version is 3.3.

Given the recent history, it is not unreasonable to expect the release of stable version 3.4. 0 in Christmas of 2024.

What's the best ruby version manager? ›

If you want a lightweight and quick version manager, use chruby. You have several choices if you want something with more extensibility and do not care about speed : ASDF if you want to manage several other language than Ruby. Rbenv if you need a versatile version manager that manages only ruby.

How to set the default version of Ruby? ›

To set a default Ruby version with rvm, enter rvm --default use 3.0. 0 on the command line. To switch to the system ruby, enter rvm use system . To switch back to the default, rvm default .

What is asdf? ›

Advanced Scientific Data Format, a form of storing astronomical data.

Which version of Ruby should I use? ›

Ruby & Rails Compatibility Table
Rails VersionRequired Ruby VersionRecommended Ruby Version
7.0.0>= 2.7.0 < 3.13.0.Z
6.1.Z>= 2.5.03.0.Z
6.0.Z>= 2.5.0 < 3.0.02.6.Z
5.2.Z>= 2.2.2 < 2.7.02.5.Z
13 more rows
Apr 24, 2024

How to check Ruby versions? ›

How can I check my Ruby version? Open your terminal, type "ruby -v" or "ruby --version" and press Enter. The terminal will display the installed Ruby version.

How do I specify which version of Ruby to use? ›

You can do this by using the ruby directive in the Gemfile :
  1. ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION', :patchlevel => 'RUBY_PATCHLEVEL' ...
  2. ruby '1.9.3', :engine => 'jruby', :engine_version => '1.6.7' ...
  3. ruby '1.9.3', :patchlevel => '448' ...
  4. ruby file: ".ruby-version" ...
  5. ruby '~> 2.3.0'

How to update Ruby to the latest version? ›

Update Ruby Version: Locate any files that specify the current Ruby version and update them. Examples of these files can be . ruby-version , Gemfile , build files and Docker if you have them. Update Bundler: Run gem install bundler to install the latest compatible version of Bundler using the updated Ruby version.

Is RVM still maintained? ›

RVM is maintained and supported by the community via issue trackers and pull requests: on each project in RVM Github organization, especially RVM project issues tracker.

How to install Ruby 3.0 1? ›

Install Ruby 3 and Bundler
  1. $ ruby --version ruby 3.0.1p64 ...
  2. $ ruby --version ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin19]
  3. $ /usr/bin/bundler --version Bundler version 1.17.2.
  4. $ /usr/local/opt/ruby/bin/bundler --version Bundler version 2.2.15.

How to Manage Your Ruby VersionsfreeCodeCamphttps://www.freecodecamp.org ›

Ruby has changed over time Ruby has been in constant development since the 1990s. And like many languages, there have been syntax changes across versions. This ...
Ruby version 3.3.4 is the default for Render services created on or after 2024-07-11. Set a different Ruby version in any of the following ways (in descending o...

Ruby Releases

Ruby Programming Language
https://www.ruby-lang.org
Ruby Programming Language
https://www.ruby-lang.org
This page lists individual Ruby releases. For information about the current maintenance status of the various Ruby branches see the Branches page. Ruby releases...

Is Ruby 3 faster than Ruby 2? ›

The answer, then, is a straightforward “yes.” Note that JIT does not “make Ruby three times faster.” It's that Ruby 3.0, which is already a lot faster than Ruby 2.0, is three times as fast as Ruby 2.0 with JIT turned on. It's fast without JIT, but not a full three times the speed of Ruby 2.0.

Which Ruby version should I use? ›

Ruby & Rails Compatibility Table
Rails VersionRequired Ruby VersionRecommended Ruby Version
7.0.0>= 2.7.0 < 3.13.0.Z
6.1.Z>= 2.5.03.0.Z
6.0.Z>= 2.5.0 < 3.0.02.6.Z
5.2.Z>= 2.2.2 < 2.7.02.5.Z
13 more rows
Apr 24, 2024

When was Ruby 2.7 6 released? ›

Ruby releases by version number
Release VersionRelease DateRelease Notes
Ruby 3.0.42022-04-12more...
Ruby 2.7.62022-04-12more...
Ruby 2.6.102022-04-12more...
Ruby 3.2.0-preview12022-04-03more...
118 more rows

When was Ruby 3.2 released? ›

Ruby 3.2. 0 was released on Christmas Day of 2022.

Top Articles
Ups Advance Auto Parts
Les Rainwater Auto Sales
Play FETCH GAMES for Free!
Ups Dropoff Location Near Me
Cottonwood Vet Ottawa Ks
Unblocked Games Premium Worlds Hardest Game
Nyu Paralegal Program
Soap2Day Autoplay
Horoscopes and Astrology by Yasmin Boland - Yahoo Lifestyle
Sissy Transformation Guide | Venus Sissy Training
Plus Portals Stscg
Stl Craiglist
Kris Carolla Obituary
Here's how eating according to your blood type could help you keep healthy
Www.paystubportal.com/7-11 Login
Love Compatibility Test / Calculator by Horoscope | MyAstrology
What Is A Good Estimate For 380 Of 60
REVIEW - Empire of Sin
Hssn Broadcasts
Watch TV shows online - JustWatch
Things To Do In Atlanta Tomorrow Night
Pvschools Infinite Campus
Truck Toppers For Sale Craigslist
Kaomoji Border
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis - NFL
800-695-2780
24 Best Things To Do in Great Yarmouth Norfolk
Jenn Pellegrino Photos
1773X To
Kamzz Llc
BMW K1600GT (2017-on) Review | Speed, Specs & Prices
Chaos Space Marines Codex 9Th Edition Pdf
What Is a Yurt Tent?
Cylinder Head Bolt Torque Values
How often should you visit your Barber?
Dtlr On 87Th Cottage Grove
Roadtoutopiasweepstakes.con
Wbli Playlist
Kvoa Tv Schedule
Honda Ruckus Fuse Box Diagram
Metro Pcs Forest City Iowa
Discover Wisconsin Season 16
Nba Props Covers
Entry of the Globbots - 20th Century Electro​-​Synthesis, Avant Garde & Experimental Music 02;31,​07 - Volume II, by Various
Andrew Lee Torres
Bill Manser Net Worth
Advance Auto.parts Near Me
Enter The Gungeon Gunther
Walmart Front Door Wreaths
Peugeot-dealer Hedin Automotive: alles onder één dak | Hedin
Gelato 47 Allbud
Craigslist Centre Alabama
Latest Posts
Article information

Author: Tuan Roob DDS

Last Updated:

Views: 6426

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Tuan Roob DDS

Birthday: 1999-11-20

Address: Suite 592 642 Pfannerstill Island, South Keila, LA 74970-3076

Phone: +9617721773649

Job: Marketing Producer

Hobby: Skydiving, Flag Football, Knitting, Running, Lego building, Hunting, Juggling

Introduction: My name is Tuan Roob DDS, I am a friendly, good, energetic, faithful, fantastic, gentle, enchanting person who loves writing and wants to share my knowledge and understanding with you.