|
| 1 | +--- |
| 2 | +layout: news_post |
| 3 | +title: "Ruby 4.0.0 preview2 Released" |
| 4 | +author: "naruse" |
| 5 | +translator: |
| 6 | +date: 2025-11-17 00:00:00 +0000 |
| 7 | +lang: en |
| 8 | +--- |
| 9 | + |
| 10 | +{% assign release = site.data.releases | where: "version", "4.0.0-preview2" | first %} |
| 11 | +We are pleased to announce the release of Ruby {{ release.version }}. Ruby 4.0 updates its Unicode version to 15.1.0, and so on. |
| 12 | + |
| 13 | +## Language changes |
| 14 | + |
| 15 | +* `*nil` no longer calls `nil.to_a`, similar to how `**nil` does |
| 16 | + not call `nil.to_hash`. [[Feature #21047]] |
| 17 | + |
| 18 | +## Core classes updates |
| 19 | + |
| 20 | +Note: We're only listing notable updates of Core class. |
| 21 | + |
| 22 | +* Binding |
| 23 | + |
| 24 | + * `Binding#local_variables` does no longer include numbered parameters. |
| 25 | + Also, `Binding#local_variable_get` and `Binding#local_variable_set` reject to handle numbered parameters. |
| 26 | + [[Bug #21049]] |
| 27 | + |
| 28 | +* IO |
| 29 | + |
| 30 | + * `IO.select` accepts +Float::INFINITY+ as a timeout argument. |
| 31 | + [[Feature #20610]] |
| 32 | + |
| 33 | +* String |
| 34 | + |
| 35 | + * Update Unicode to Version 15.1.0 and Emoji Version 15.1. [[Feature #19908]] |
| 36 | + (also applies to Regexp) |
| 37 | + |
| 38 | + |
| 39 | +## Standard Library updates |
| 40 | + |
| 41 | +Note: We're only listing notable updates of Standard librarires. |
| 42 | + |
| 43 | +* ostruct 0.6.1 |
| 44 | +* pstore 0.2.0 |
| 45 | +* benchmark 0.4.0 |
| 46 | +* logger 1.7.0 |
| 47 | +* rdoc 6.13.1 |
| 48 | +* win32ole 1.9.2 |
| 49 | +* irb 1.15.2 |
| 50 | +* reline 0.6.1 |
| 51 | +* readline 0.0.4 |
| 52 | +* fiddle 1.1.6 |
| 53 | + |
| 54 | +## Compatibility issues |
| 55 | + |
| 56 | +Note: Excluding feature bug fixes. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +## Standard library compatibility issues |
| 61 | + |
| 62 | + |
| 63 | +## C API updates |
| 64 | + |
| 65 | + |
| 66 | +## JIT |
| 67 | + |
| 68 | +* YJIT |
| 69 | + * YJIT stats |
| 70 | + * `ratio_in_yjit` no longer works in the default build. |
| 71 | + Use `--enable-yjit=stats` on `configure` to enable it on `--yjit-stats`. |
| 72 | + * Add `invalidate_everything` to default stats, which is |
| 73 | + incremented when every code is invalidated by TracePoint. |
| 74 | + * Add `mem_size:` and `call_threshold:` options to `RubyVM::YJIT.enable`. |
| 75 | +* ZJIT |
| 76 | + * Add an experimental method-based JIT compiler. |
| 77 | + Use `--enable-zjit` on `configure` to enable the `--zjit` support. |
| 78 | + * As of Ruby 4.0.0-preview2, ZJIT is not yet ready for speeding up most benchmarks. |
| 79 | + Please refrain from evaluating ZJIT just yet. Stay tuned for the Ruby 4.0 release. |
| 80 | +* RJIT |
| 81 | + * `--rjit` is removed. We will move the implementation of the third-party JIT API |
| 82 | + to the [ruby/rjit](https://github.com/ruby/rjit) repository. |
| 83 | + |
| 84 | +## Miscellaneous changes |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +See [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md) |
| 89 | +or [commit logs](https://github.com/ruby/ruby/compare/v3_4_0...{{ release.tag }}) |
| 90 | +for more details. |
| 91 | + |
| 92 | +With those changes, [{{ release.stats.files_changed }} files changed, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} deletions(-)](https://github.com/ruby/ruby/compare/v3_4_0...{{ release.tag }}#file_bucket) |
| 93 | +since Ruby 3.4.0! |
| 94 | + |
| 95 | +## Download |
| 96 | + |
| 97 | +* <{{ release.url.gz }}> |
| 98 | + |
| 99 | + SIZE: {{ release.size.gz }} |
| 100 | + SHA1: {{ release.sha1.gz }} |
| 101 | + SHA256: {{ release.sha256.gz }} |
| 102 | + SHA512: {{ release.sha512.gz }} |
| 103 | + |
| 104 | +* <{{ release.url.xz }}> |
| 105 | + |
| 106 | + SIZE: {{ release.size.xz }} |
| 107 | + SHA1: {{ release.sha1.xz }} |
| 108 | + SHA256: {{ release.sha256.xz }} |
| 109 | + SHA512: {{ release.sha512.xz }} |
| 110 | + |
| 111 | +* <{{ release.url.zip }}> |
| 112 | + |
| 113 | + SIZE: {{ release.size.zip }} |
| 114 | + SHA1: {{ release.sha1.zip }} |
| 115 | + SHA256: {{ release.sha256.zip }} |
| 116 | + SHA512: {{ release.sha512.zip }} |
| 117 | + |
| 118 | +## What is Ruby |
| 119 | + |
| 120 | +Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993, |
| 121 | +and is now developed as Open Source. It runs on multiple platforms |
| 122 | +and is used all over the world especially for web development. |
0 commit comments