New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruby 3.0 Support #6878
Comments
@headius could you please tick the "--backtrace-limit option" here ? thanks |
@edipofederle Done, and fixed formatting and added a checkbox for |
GC.auto_compact is added but does nothing (we do not have that level of control over JVM GCs). |
The Kernel#clone changes are partially implemented in this gist, but the Ruby changes here seem to trigger a bug in IR: https://gist.github.com/headius/32ecf9c7b669e48e34e99958fa8a8d0d |
The replacement of our own patched DRb with the gem version has led to a hang in the |
To clarify... the gem version of DRb attempts to use |
@edipofederle Ok! |
The english gem appears to install correctly now. |
Updated based on current master. |
Remaining items are in #7459. |
Ruby 2.7 Note
This list, as mentioned below, is changed or added features since the Ruby 2.7.0 release. However, since JRuby skipped Ruby 2.7 (JRuby 9.3 was 2.6 compatible and 9.4 is 3.0 compatible), we will also need to audit that list of features and ensure that any changes exclusive to 2.7 are also implemented.
See #6464 for the checklist of Ruby 2.7 features.
Ruby specs for 2.7 and 3.0
Many specs have already been added for Ruby 2.7 and Ruby 3.0 behaviors, but there are always gaps! Please help write a complete set of executable Ruby specifications for these releases. Your efforts will help Rubyists worldwide have a better understanding of Ruby and better tools to use it.
Ruby 2.7: ruby/spec#745
Ruby 3.0: ruby/spec#823
Full list of changes for Ruby 3.0.0
NOTE: https://rubyreferences.github.io/rubychanges/3.0.html gives more details for many features and changes. From https://github.com/ruby/ruby/blob/master/doc/NEWS-3.0.0.md and ruby/spec#823:
This document is a list of user visible feature changes since the 2.7.0 release, except for bug fixes.
Note that each entry is kept to a minimum, see links for details.
Language changes
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. [Feature #14183]
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
[Feature #16166]
...
) now supports leading arguments.[Feature #16378]
case/in
) is no longer experimental. [Feature #17260]=>
is added. It can be used like a rightward assignment.[Feature #17260]
in
is changed to returntrue
orfalse
. [Feature #17371][Feature #16828]
[Feature #16746]
# frozen-string-literal: true
is used. [Feature #17104]shareable_constant_value
added to freeze constants #7457 Magic comment shareable_constant_value added to freeze constants.See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.[Feature #17273] (Parses in JRuby but currently ignored due to not supporting Ractor)
Turn them on with
-W:deprecated
(or with-w
to show other warnings too).[Feature #16345] (Add support for -W:category flag #7436)
$SAFE
and$KCODE
are now normal global variables with no special behavior.C-API methods related to
$SAFE
have been removed.[Feature #16131] [Feature #17136], $KCODE and $-k vars are normal globals now #7369
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. [Feature #15575]
[Bug #14541]
a warning.
Command line options
--help
optionWhen the environment variable
RUBY_PAGER
orPAGER
is present and has a non-empty value, and the standard input and output are tty, the--help
option shows the help message via the pager designated by the value. [Feature #16754] (Pager support for --help #7458)--backtrace-limit
optionThe
--backtrace-limit
option limits the maximum length of a backtrace. [Feature #8661]Core classes updates
Outstanding ones only.
Array
subclass instances when called on subclass instances:
[Bug #6087]
Binding
"(eval)"
for
__FILE__
and1
for__LINE__
in the evaluated code.[Bug #4352] [Bug #17419]
ConditionVariable
block
/unblock
schedulerhooks in a non-blocking context. [Feature #16786]
Dir
accept the
sort:
keyword option. [Feature #8709, https://github.com/Dir.glob fixes #6917]ENV
given keys and their values. [Feature #15822]
[Feature #12650]
Encoding
[Feature #16604]
Fiber
See #7438.
execution contexts. [Feature #16786]
[Feature #16815]
GC
when compaction runs. Setting
auto_compact=
totrue
will causecompaction to occur during major collections. At the moment,
compaction adds significant overhead to major collections, so please
test first! [Feature #17176]
Hash
keys to new keys. [Feature #16274]
given keys and their values. [Feature #15822]
IO
true
. [Feature #16786]related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook
#io_wait(io, events, timeout)
in a non-blocking execution context.[Feature #16786]
Kernel
freeze: false
keyword will call#initialize_clone
with thefreeze: false
keyword.[Bug #14266]
freeze: true
keyword will call#initialize_clone
with thefreeze: true
keyword, and willreturn a frozen copy even if the receiver is unfrozen.
[Feature #16175]
"(eval)"
for
__FILE__
and1
for__LINE__
in the evaluated code.[Bug #4352]
[Feature #15973]
#kernel_sleep(...)
in anon-blocking execution context. [Feature #16786]
Module
that have already included or prepended the receiver, mirroring the
behavior if the arguments were included in the receiver before
the other modules and classes included or prepended the receiver.
[Feature #9573], Also include/prepend into existing include hiers #7377
Module#private_class_method, toplevel "private" and "public" methods
now accept single array argument with a list of method names. [Feature #17314] (Expand this array logic #6933)
methods now return an array of defined method names as symbols.
[Feature #17314]
[Feature #17314]
Mutex
Mutex
is now acquired per-Fiber
instead of per-Thread
. This changeshould be compatible for essentially all usages and avoids blocking when
using a scheduler. [Feature #16792]
Proc
separate Proc instances if the procs were created from the same block.
[Feature #14267]
Queue / SizedQueue
block
/unblock
scheduler hooks in a non-blocking context.[Feature #16786]
Ractor
more details.
Random
Random::DEFAULT
now refers to theRandom
class instead of being aRandom
instance,so it can work with
Ractor
.[Feature #17322]
Random::DEFAULT
is deprecated since its value is now confusing and it is no longer global,use
Kernel.rand
/Random.rand
directly, or create aRandom
instance withRandom.new
instead.[Feature #17351]
String
instead of subclass instances when called on subclass instances:
[Bug #10845]
Symbol
if it is named. The returned string is frozen. [Feature #16150]
Fiber
See #7438.
Fiber.scheduler for accessing the current scheduler. See
rdoc-ref:fiber.md for more details about what operations are supported and
how to implement the scheduler hooks. [Feature #16786]
blocking. [Feature #16786]
block
/unblock
in anon-blocking execution context. [Feature #16786]
Thread
default deadlock detection, allowing the use of signal handlers to
break deadlock. [Bug #13768], Implement Thread.ignore_deadlock as no-op #7368
Warning
[Feature #17122]
Stdlib updates
Set
set
gem in Remove SortedSet implementations ruby/set#2, JRuby issue forsorted_set
in JRuby support that is not a no-op knu/sorted_set#7, PR to remove from JRuby in Remove SortedSet #6922).to_a.join
.Socket
Compatibility issues
Excluding feature bug fixes.
{ a: 1 }.each(&->(k, v) { })
raises an ArgumentErrordue to lambda's arity check.
error message will be shown now. [Feature #14413]
TRUE
/FALSE
/NIL
constants are no longer defined.Regexp.last_match. [Bug #17030]
Kernel#open
.Call
URI.open
directly oruse URI#open
instead. [Misc #15893]Stdlib compatibility issues
Implementation improvements
in parallel and synchronization is needed even for method caches. However,
such synchronization can be overhead so introducing new inline method cache
mechanisms, (1) Disposable inline method cache (2) per-Class method cache
and (3) new invalidation mechanism. (1) can avoid per-method call
synchronization because it only uses atomic operations.
See the ticket for more details.
a method call has been reduced to a maximum of 1, and passing
a keyword splat to a method that accepts specific keywords
does not allocate a hash.
super
is optimized when the same type of method is called in the previous callif it's not refinements or an attr reader or writer.
Miscellaneous changes
ruby2_keywords
will no longer keep empty keywordsplats, those are now removed just as they are for methods not
using
ruby2_keywords
.message and backtrace are printed in order from the innermost.
[Feature #8661]
warning in verbose mode. [Feature #17055]inxlusw
The text was updated successfully, but these errors were encountered: