|
| 1 | +--- |
| 2 | +layout: news_post |
| 3 | +title: "Ruby 3.3.0-preview1 Released" |
| 4 | +author: "naruse" |
| 5 | +translator: |
| 6 | +date: 2023-05-12 00:00:00 +0000 |
| 7 | +lang: en |
| 8 | +--- |
| 9 | + |
| 10 | +{% assign release = site.data.releases | where: "version", "3.3.0-preview1" | first %} |
| 11 | + |
| 12 | +We are pleased to announce the release of Ruby {{ release.version }}. Ruby 3.3 adds a new pure-Ruby JIT compiler named RJIT, uses Lrama as a parser generator, and many performance improvements especially YJIT. |
| 13 | + |
| 14 | +## RJIT |
| 15 | + |
| 16 | +* Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT. |
| 17 | + * RJIT supports only x86\_64 architecture on Unix platforms. |
| 18 | + * Unlike MJIT, it doesn't require a C compiler at runtime. |
| 19 | +* RJIT exists only for experimental purposes. |
| 20 | + * You should keep using YJIT in production. |
| 21 | +* If you are interested in developing JIT for Ruby, please check out [k0kubun's presentation on Day 3 of RubyKaigi](https://rubykaigi.org/2023/presentations/k0kubun.html#day3). |
| 22 | + |
| 23 | +## Use Lrama instead of Bison |
| 24 | + |
| 25 | +* Replace Bison with [Lrama LALR parser generator](https://github.com/yui-knk/lrama) [Feature #19637](https://bugs.ruby-lang.org/issues/19637) |
| 26 | + * If you have interest, please see [The future vision of Ruby Parser](https://rubykaigi.org/2023/presentations/spikeolaf.html) |
| 27 | + |
| 28 | +## YJIT |
| 29 | + |
| 30 | +* Significant performance improvements over 3.2 |
| 31 | + * Splat and rest arguments support has been improved. |
| 32 | + * Registers are allocated for stack operations of the virtual machine. |
| 33 | + * More calls with optional arguments are compiled. |
| 34 | + * `Integer#!=`, `String#!=`, `Kernel#block_given?`, `Kernel#is_a?`, |
| 35 | + `Kernel#instance_of?`, `Module#===` are specially optimized. |
| 36 | + * Instance variables no longer exit to the interpreter |
| 37 | + with megamorphic Object Shapes. |
| 38 | +* Metadata for compiled code uses a lot less memory. |
| 39 | +* Improved code generation on ARM64 |
| 40 | +* Option to start YJIT in paused mode and then later enable it manually |
| 41 | + * `--yjit-pause` and `RubyVM::YJIT.resume` |
| 42 | + * This can be used to enable YJIT only once your application is done booting |
| 43 | +* Exit tracing option now supports sampling |
| 44 | + * `--trace-exits-sample-rate=N` |
| 45 | +* Multiple bug fixes |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +## Other Notable New Features |
| 50 | + |
| 51 | +### Language |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +## Performance improvements |
| 56 | + |
| 57 | +* `defined?(@ivar)` is optimized with Object Shapes. |
| 58 | + |
| 59 | +## Other notable changes since 3.2 |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +## Compatibility issues |
| 64 | + |
| 65 | +Note: Excluding feature bug fixes. |
| 66 | + |
| 67 | +### Removed constants |
| 68 | + |
| 69 | +The following deprecated constants are removed. |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +### Removed methods |
| 74 | + |
| 75 | +The following deprecated methods are removed. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +## Stdlib compatibility issues |
| 80 | + |
| 81 | +### `ext/readline` is retired |
| 82 | + |
| 83 | +* 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`. |
| 84 | +* We no longer need to install libraries like `libreadline` or `libedit`. |
| 85 | + |
| 86 | +## C API updates |
| 87 | + |
| 88 | +### Updated C APIs |
| 89 | + |
| 90 | +The following APIs are updated. |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | +### Removed C APIs |
| 95 | + |
| 96 | +The following deprecated APIs are removed. |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +## Standard library updates |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +The following default gems are updated. |
| 105 | + |
| 106 | +* RubyGems 3.5.0.dev |
| 107 | +* bigdecimal 3.1.4 |
| 108 | +* bundler 2.5.0.dev |
| 109 | +* csv 3.2.7 |
| 110 | +* fiddle 1.1.2 |
| 111 | +* fileutils 1.7.1 |
| 112 | +* irb 1.6.4 |
| 113 | +* optparse 0.4.0.pre.1 |
| 114 | +* psych 5.1.0 |
| 115 | +* reline 0.3.3 |
| 116 | +* stringio 3.0.7 |
| 117 | +* strscan 3.0.7 |
| 118 | +* syntax_suggest 1.0.4 |
| 119 | +* time 0.2.2 |
| 120 | +* timeout 0.3.2 |
| 121 | +* uri 0.12.1 |
| 122 | + |
| 123 | +The following bundled gems are updated. |
| 124 | + |
| 125 | +* minitest 5.18.0 |
| 126 | +* rbs 3.1.0 |
| 127 | +* typeprof 0.21.7 |
| 128 | +* debug 1.8.0 |
| 129 | + |
| 130 | +See GitHub releases like [Logger](https://github.com/ruby/logger/releases) or |
| 131 | +changelog for details of the default gems or bundled gems. |
| 132 | + |
| 133 | +See [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) |
| 134 | +or [commit logs](https://github.com/ruby/ruby/compare/v3_2_0...{{ release.tag }}) |
| 135 | +for more details. |
| 136 | + |
| 137 | +With those changes, [{{ release.stats.files_changed }} files changed, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} deletions(-)](https://github.com/ruby/ruby/compare/v3_2_0...{{ release.tag }}#file_bucket) |
| 138 | +since Ruby 3.2.0! |
| 139 | + |
| 140 | +## Download |
| 141 | + |
| 142 | +* <{{ release.url.gz }}> |
| 143 | + |
| 144 | + SIZE: {{ release.size.gz }} |
| 145 | + SHA1: {{ release.sha1.gz }} |
| 146 | + SHA256: {{ release.sha256.gz }} |
| 147 | + SHA512: {{ release.sha512.gz }} |
| 148 | + |
| 149 | +* <{{ release.url.xz }}> |
| 150 | + |
| 151 | + SIZE: {{ release.size.xz }} |
| 152 | + SHA1: {{ release.sha1.xz }} |
| 153 | + SHA256: {{ release.sha256.xz }} |
| 154 | + SHA512: {{ release.sha512.xz }} |
| 155 | + |
| 156 | +* <{{ release.url.zip }}> |
| 157 | + |
| 158 | + SIZE: {{ release.size.zip }} |
| 159 | + SHA1: {{ release.sha1.zip }} |
| 160 | + SHA256: {{ release.sha256.zip }} |
| 161 | + SHA512: {{ release.sha512.zip }} |
| 162 | + |
| 163 | +## What is Ruby |
| 164 | + |
| 165 | +Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, |
| 166 | +and is now developed as Open Source. It runs on multiple platforms |
| 167 | +and is used all over the world especially for web development. |
0 commit comments