-
Notifications
You must be signed in to change notification settings - Fork 187
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 2.7 support #2004
Comments
As written in
So adding 2.7 features as long as they don't conflict significantly with Ruby 2.6 semantics is fine. Regarding 1, I guess it's mostly changes the Regarding 2, it seems quite some work and it's unclear if much code uses it yet.
So PRs for that are definitely welcome, but I guess it's not used in many gems yet, and so not so important for compatibility in general (yet). Regarding 3, that's probably easy to implement in pure Ruby. For each of these it would be helpful to have a separate issue so we can prioritize and triage it as needed. Finally, regarding general plans for 2.7 at the moment I'm hesitant because of keyword arguments changes. Implementing the keyword arguments semantics of 2.7 seem a lot of work (at least to support the warnings), for semantics that only last for one Ruby version (semantics are significantly simpler in Ruby 2.8+). So we might want to skip the 2.7 "transition release" and go straight to Ruby 2.8 in terms of reported Individual features from 2.7 that are compatible are all welcome though. |
We're now planning to target Ruby 2.7 for the GraalVM/TruffleRuby 21.0.0 release. |
I merged initial support for Ruby 2.7 in 08187f1. Remaining:
New tagged specs: New excluded MRI tests: |
I'll also copy the checklist from ruby/spec#745 as it might be useful to track progress, and to show individual things to fix. NOTE: https://rubyreferences.github.io/rubychanges/2.7.html gives more details for many features and changes. NEWS for Ruby 2.7.0This document is a list of user visible feature changes made between Changes since the 2.6.0 releaseLanguage changesPattern matching
case [0, [1, 2, 3]]
in [a, [b, *c]]
p a #=> 0
p b #=> 1
p c #=> [2, 3]
end
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "name": "Bob", "age": 2 }]
}
END
JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: name, age: age}]}
p name #=> "Bob"
p age #=> 2
JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: "Charlie", age: age}]}
#=> NoMatchingPatternError See the following slides for more details:
The spec of keyword arguments is changed towards 3.0
def foo(**kw); p kw; end; foo("str" => 1) #=> {"str"=>1}
def foo(h, **nil); end; foo(key: 1) # ArgumentError
def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError
def foo(h, **nil); end; foo("str" => 1) # ArgumentError
def foo(h, **nil); end; foo({key: 1}) # OK
def foo(h, **nil); end; foo({"str" => 1}) # OK
h = {}; def foo(*a) a end; foo(**h) # []
h = {}; def foo(a) a end; foo(**h) # {} and warning
h = {}; def foo(*a) a end; foo(h) # [{}]
h = {}; def foo(a) a end; foo(h) # {}
Numbered parameters
proc/lambda without block is deprecated
Other miscellaneous changes
Command line optionsWarning optionThe
See also Warning in {Core classes updates}[#label-Core+classes+updates+-28outstanding+ones+only-29]. Core classes updates (outstanding ones only)Array
Comparable
Complex
Dir
Encoding
Enumerable
Enumerator
Fiber
File
FrozenError
GC
IO
Integer
Method
Module
NilClass / TrueClass / FalseClass
ObjectSpace::WeakMap
Proc
Range
String
Symbol
Time
UnboundMethod
Warning
$LOAD_PATH
Stdlib updates (outstanding ones only)
Compatibility issues (excluding feature bug fixes)
Proc
Range
Stdlib compatibility issues (excluding feature bug fixes)
pathname
C API updates
|
I'll start with |
I'll take a stab at the |
I'm marking "The flip-flop syntax deprecation is reverted." as done, since it doesn't seem we emitted the deprecation warning in the first place. |
Could you also mark enumerator#produce as done per #2160 ? Thanks! |
taking Integer#[] now supports range operations |
|
Are there specs for it? If so do they need to be untagged, if not we should add at least a couple. |
…ance_method` (#2004) PullRequest: truffleruby/2383
Very few things left from the list above:
|
I looked into |
truffleruby/src/main/c/cext/class.c Lines 79 to 82 in 169bce9
The *_kw functions can be found by git grep -E 'rb_.+_kw\b' lib/cext/include/ruby .
|
I thought that |
@gogainda At this point it seems unnecessary, because of how we handle keyword arguments in TruffleRuby. |
I think it's time to mark this issue as solved, we already support most of 2.7 since 21.0.0/21.1.0. Remaining from the list is:
Those don't seem used much so I think we'll just pragmatically add them when we see an app/gem needing them. |
Is there any plan to add new Ruby 2.7 goodies in near future? In my list are these:
Enumerator.produce
The text was updated successfully, but these errors were encountered: