A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ below:

Ruby 3.4.0 Released

Posted by naruse on 25 Dec 2024

We are pleased to announce the release of Ruby 3.4.0. Ruby 3.4 adds it block parameter reference, changes Prism as default parser, adds Happy Eyeballs Version 2 support to socket library, improves YJIT, adds Modular GC, and so on.

it is introduced

it is added to reference a block parameter with no variable name. [Feature #18980]

ary = ["foo", "bar", "baz"]

p ary.map { it.upcase } #=> ["FOO", "BAR", "BAZ"]

it very much behaves the same as _1. When the intention is to only use _1 in a block, the potential for other numbered parameters such as _2 to also appear imposes an extra cognitive load onto readers. So it was introduced as a handy alias. Use it in simple cases where it speaks for itself, such as in one-line blocks.

Prism is now the default parser

Switch the default parser from parse.y to Prism. [Feature #20564]

This is an internal improvement and there should be little change visible to the user. If you notice any compatibility issues, please report them to us.

To use the conventional parser, use the command-line argument --parser=parse.y.

The socket library now features Happy Eyeballs Version 2 (RFC 8305)

The socket library now features Happy Eyeballs Version 2 (RFC 8305), the latest standardized version of a widely adopted approach for better connectivity in many programming languages, in TCPSocket.new (TCPSocket.open) and Socket.tcp. This improvement enables Ruby to provide efficient and reliable network connections, adapted to modern internet environments.

Until Ruby 3.3, these methods performed name resolution and connection attempts serially. With this algorithm, they now operate as follows:

  1. Performs IPv6 and IPv4 name resolution concurrently
  2. Attempt connections to the resolved IP addresses, prioritizing IPv6, with parallel attempts staggered at 250ms intervals
  3. Return the first successful connection while canceling any others

This ensures minimized connection delays, even if a specific protocol or IP address is delayed or unavailable. This feature is enabled by default, so additional configuration is not required to use it. To disable it globally, set the environment variable RUBY_TCP_NO_FAST_FALLBACK=1 or call Socket.tcp_fast_fallback=false. Or to disable it on a per-method basis, use the keyword argument fast_fallback: false.

YJIT TL;DR New features New optimizations Modular GC Language changes Core classes updates

Note: We’re only listing notable updates of Core class.

Standard Library updates

Note: We’re only listing notable updates of Standard libraries.

Compatibility issues

Note: Excluding feature bug fixes.

Standard library compatibility issues C API updates Miscellaneous changes

See NEWS or commit logs for more details.

With those changes, 4942 files changed, 202244 insertions(+), 255528 deletions(-) since Ruby 3.3.0!

Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.4!

Download What is Ruby

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