Project

General

Profile

Activity

From 06/21/2020 to 06/27/2020

06/27/2020

09:26 PM Bug #16997 (Open): IO#gets converts some \r\n to \n with universal_newline: false
Reproduction code:
```
IO.binwrite "t.csv", ("a" * 100 + "\r\n") * 100
File.open("t.csv", encoding: "BOM|UTF-8", universal_newline: false) do |input|
p input.gets(nil, 32 * 1024) # => "a...a\n...\na...a\r\n...\r\n"
end
```
It ...
scivola20 (sciv ola)
07:12 PM Feature #16984: Remove write barrier exemption for T_ICLASS
Thank you for great work. This kind of hack can cause BUGs easily.
> Private app A's heap size is about 22 MiB compared to B's 250 MiB.
Could you measure the memory/objects consumption before and after this patch if it is not diffi...
ko1 (Koichi Sasada)
06:31 PM Feature #16986: Anonymous Struct literal
First of all, this is super cool idea!
I do have habit to use hash since it is seems to be elegant (as described in original proposal background section) and I end up having problems later (since I need to use fetch everywhere to get ...
retro (Josef Šimánek)
06:08 PM Feature #16986: Anonymous Struct literal
Other syntax ideas, by others:
* Other prefixes
* `::{a: 1}`
* `\{a: 1}`
* `<>` to indicate
* `{<> a:1}` for anonymous Struct.
* `{<A> a:1}` for named Struct, the name is `A`.
* Similar with `%`
* `{% a:1}` for anonymous Struc...
ko1 (Koichi Sasada)
05:55 PM Feature #16986: Anonymous Struct literal
# Q&A
## Splat like Hash literal and method arguments
https://bugs.ruby-lang.org/issues/16986#note-3
> I was wondering if ${} can do the following things compared to Hash literals:
Not allowed because of vulnerability concerns (please...
ko1 (Koichi Sasada)
02:28 PM Feature #16986: Anonymous Struct literal
I like the idea of being able to quickly create an anonymous Struct but am concerned about the use of `$` for the syntax since that hinders readability and causes confusion due to `$` generally denoting a *global variable*. Why not allow... bkuhlmann (Brooke Kuhlmann)
12:37 PM Feature #16986: Anonymous Struct literal
`struct = (a: 1, b: 2)` would be a great syntax, because I think anonymous struct is something like Tuple of Python.
But, there are two problems:
1. `()` returns `nil`, not an empty struct.
2. The meaning of `p(a: 1)` and `p (a: 1)...
ttanimichi (Tsukuru Tanimichi)
05:07 PM Revision 0703e014 (git): Mark some Integer methods as inline (#3264)
k0kubun (Takashi Kokubun)
05:03 PM Revision 247dd874 (git): * 2020-06-28 [ci skip]
git[bot]
04:37 PM Bug #16996: Hash should avoid doing unnecessary rehash
Dan0042 (Daniel DeLorme) wrote in #note-2:
> Shouldn't the rehash be tied to a change in the number of buckets rather than which method is used?
> ...
I think you might be confusing the re-organizing of a Hash's internal structure into...
marcandre (Marc-Andre Lafortune)
04:00 PM Bug #16996: Hash should avoid doing unnecessary rehash
Very surprising results for `Hash#dup`. I even tried `h.rehash` before the benchmark, with no effect.
Shouldn't the rehash be tied to a change in the number of buckets rather than which method is used?
`select{true}` doesn't change t...
Dan0042 (Daniel DeLorme)
11:48 AM Bug #16996: Hash should avoid doing unnecessary rehash
Completely agreed, `Hash#dup` should not rehash (and it already doesn't on TruffleRuby). Eregon (Benoit Daloze)
08:20 AM Bug #16996 (Closed): Hash should avoid doing unnecessary rehash
Pop quiz: Which is the fastest way to get a copy of a Hash `h`?
If, like me, you thought `h.dup` (of course, right?), you are actually wrong.
The fastest way is to call `h.merge`. Try it:
```
require 'benchmark/ips'
lengths ...
marcandre (Marc-Andre Lafortune)
04:03 PM Revision c405a8d3 (git): [ruby/fiddle] try bundled libffi by default
If no installed libffi found, use bundled libffi unless explicitly
`--disable-bundled-libffi` option is given.
nobu (Nobuyoshi Nakada)
02:54 PM Revision f2bcdc72 (git): [ruby/fiddle] Support MSWIN (#43)
https://github.com/ruby/fiddle/commit/f16e7ff6e0 Sutou Kouhei
02:54 PM Revision a40b390b (git): [ruby/fiddle] test windows: use _snprintf
https://github.com/ruby/fiddle/commit/aa261bdb9f Sutou Kouhei
02:54 PM Revision 6429b6d9 (git): [ruby/fiddle] Add missing include
https://github.com/ruby/fiddle/commit/4ca61efcd7 Sutou Kouhei
02:54 PM Revision ae18220f (git): [ruby/fiddle] Add support for variadic arguments
GitHub: fix GH-39
Reported by kojix2. Thanks!!!
https://github.com/ruby/fiddle/commit/6c4cb904dc
Sutou Kouhei
02:54 PM Revision 9f740aca (git): [ruby/fiddle] Use meaningful variable name
https://github.com/ruby/fiddle/commit/2cac24b7c8 Sutou Kouhei
02:54 PM Revision 50fbd00e (git): [ruby/fiddle] Use "do { } while (0)" to ensure requiring ";"
https://github.com/ruby/fiddle/commit/2155ae5979 Sutou Kouhei
02:40 PM Revision 0faf6c8c (git): Update to ruby/spec@6c466d4
Eregon (Benoit Daloze)
02:15 PM Revision 25fbc886 (git): Removed non-ASCII code to suppress warnings by localized compilers
nobu (Nobuyoshi Nakada)
01:51 PM Revision b3fa158d (git): Update to ruby/spec@b6b7752
Eregon (Benoit Daloze)
01:51 PM Revision 64d8c081 (git): Update to ruby/mspec@6cb1f10
Eregon (Benoit Daloze)
09:14 AM Feature #16812: Allow slicing arrays with ArithmeticSequence
> But a negative start with a non-negative end is quite weird. What is that operation even supposed to mean? What is it useful for?
I believe such edge cases might emerge not being directly written, but when dynamically calculated. Im...
zverok (Victor Shepelev)
05:44 AM Feature #16993: Sets: from hash keys using Hash#key_set
sawa (Tsuyoshi Sawada) wrote in #note-2:
> Would
> ...
It will definitely work, but it will be the same as `Set.new(h.keys)` (a bit slower because enumerator is a bit slow). It still iterates on the keys, and add them to the new hash.
...
marcandre (Marc-Andre Lafortune)
01:55 AM Feature #16993: Sets: from hash keys using Hash#key_set
Would
```ruby
Set.new(h.each_key)
```
not work?
sawa (Tsuyoshi Sawada)
05:43 AM Revision 609ac6ee (git): Revert "Try increasing read timeout of rinda tests"
This reverts commit 5c03e4680e724faeedb2c5fc1581d5fcb66aaff2.
I gave up stabilizing Rinda::TupleSpaceProxyTest#test_cancel_02. As the
test uses sleep, it's probably not gonna be stable with --jit-wait.
http://ci.rvm.jp/results/trunk-mj...
k0kubun (Takashi Kokubun)
04:53 AM Revision 600f3990 (git): Cosmetic change
ktsj (Kazuki Tsujimoto)
04:52 AM Revision 7a5a0dfa (git): Suppress "assigned but unused variable" warnings
ktsj (Kazuki Tsujimoto)
04:51 AM Revision c9ee34a1 (git): Add #deconstruct cache to find pattern
palkan (Vladimir Dementyev)
04:51 AM Revision 53203757 (git): Optimize array pattern matching by caching #deconstruct value
palkan (Vladimir Dementyev)
04:51 AM Revision 6770d8f1 (git): Add pattern matching with arrays benchmark
palkan (Vladimir Dementyev)
03:29 AM Bug #16979: FileUtils#cp_r with preserve, lchmod fails with ENOTSUPP
ruby_2_7 799c5766a4dc215d139d2c26ac68636f43a64fbf merged revision(s) a19228f878d955eaf2cce086bcf53f46fdf894b9. nagachika (Tomoyuki Chikanaga)
02:17 AM Bug #16979 (Closed): FileUtils#cp_r with preserve, lchmod fails with ENOTSUPP
Closed to backport. nobu (Nobuyoshi Nakada)
03:29 AM Revision 799c5766 (git): merge revision(s) a19228f878d955eaf2cce086bcf53f46fdf894b9: [Backport #16979]
brace the fact that lchmod(2) can EOPNOTSUPP
Musl libc has this function as a tiny wrapper of fchmodat(3posix). On
the other hand Linux kernel does not support changing modes of a symlink.
The operation always f...
nagachika (Tomoyuki Chikanaga)
03:21 AM Bug #16981: [ripper] mismatched indentations warning has disappeared since 2.6
ruby_2_7 d8a32b146561a0ddd3e60da9863a082b7e7725db merged revision(s) 263b941321c3de6afc8f9dafbc2625f866b7437e. nagachika (Tomoyuki Chikanaga)
03:20 AM Revision d8a32b14 (git): merge revision(s) 263b941321c3de6afc8f9dafbc2625f866b7437e: [Backport #16981]
[ripper] fix mismatched indentations warning [Bug #16981]
The scanner location has to be set from `lex.ptok` before it is
flushed by dispatching the scanner event.
nagachika (Tomoyuki Chikanaga)
02:14 AM Feature #16989 (Assigned): Sets: need ♥️
nobu (Nobuyoshi Nakada)
02:11 AM Bug #16988: Kernel.load loads file from current directory without '.' in path
I don’t this is an implementation bug, but a documentation issue. nobu (Nobuyoshi Nakada)
01:55 AM Revision d6c9c014 (git): * 2020-06-27 [ci skip]
git[bot]
01:55 AM Revision 74c345c7 (git): Removed no longer used flags
nobu (Nobuyoshi Nakada)
01:55 AM Revision 61984d47 (git): Not to rewrite node while compiling
Moved this hack mark to an argument to `compile_hash`.
> Bad Hack: temporarily mark hash node with flag so
> compile_hash can compile call differently.
nobu (Nobuyoshi Nakada)

06/26/2020

08:43 PM Feature #16995 (Closed): Sets: <=> should be specialized
This is quite minor, but `Set#<=>` should be refined.
Reminder: `Set` defines `<`, `>`, etc. as inclusion, but does not have a corresponding `<=>`:
```ruby
Set[1] < Set[1, 2] # => true
Set[1] <=> Set[1, 2] # => nil, should be -1
...
marcandre (Marc-Andre Lafortune)
08:32 PM Feature #16994 (Feedback): Sets: shorthand for frozen sets of symbols / strings
I would like a shorthand syntax for *frozen Sets of symbols or of strings*.
I am thinking of:
```ruby
%ws{hello world} # => Set['hello', 'world'].freeze
%is{hello world} # => Set[:hello, :world].freeze
```
The individual stri...
marcandre (Marc-Andre Lafortune)
08:31 PM Feature #16993 (Open): Sets: from hash keys using Hash#key_set
To create a set from hash keys currently implies a temporary array for all keys, rehashing all those keys and rebuilding a hash. Instead, the hash could be copied and its values set to `true`.
```ruby
h = {a: 1}
# Now:
Set.new(h.ke...
marcandre (Marc-Andre Lafortune)
08:30 PM Feature #16992 (Assigned): Sets: officially ordered
Officially, set elements have uncertain order. This predades when Hash started being ordered (Ruby 1.9.0, Xmas 2007). Sets have since been de-facto insertion-ordered. FYI, in those 13 years, there have been about 70 commits to `lib/set.r... marcandre (Marc-Andre Lafortune)
08:29 PM Feature #16991 (Closed): Sets: add Set#join
I'd like to add `#join` to `Set`:
```ruby
# Now:
Set[1, 2, 3].join('x') # => NoMethodError
# After
Set[1, 2, 3].join('x') # => "1x2x3"
```
I'd make this join never recursive. (I've never wanted to use the recursivity of `Array...
marcandre (Marc-Andre Lafortune)
08:27 PM Feature #16990 (Open): Sets: operators compatibility with Array
We currently have `set <operator> array` work fine:
```ruby
Set[1] + [2] # => Set[1, 2]
```
Nothing works in the reverse order:
```ruby
[1] + Set[2] # => no implicit conversion of Set into Array
# should be:
[1] + Set[2] # ...
marcandre (Marc-Andre Lafortune)
08:18 PM Feature #16989 (Assigned): Sets: need ♥️
I am opening a series of feature requests on `Set`, all of them based on this usecase.
The main usecase I have in mind is my recent experience with `RuboCop`. I noticed a big number of frozen arrays being used only to later call `incl...
marcandre (Marc-Andre Lafortune)
07:08 PM Feature #16812: Allow slicing arrays with ArithmeticSequence
mrkn (Kenta Murata) wrote in #note-7:
> It may be better to change the behavior of `[*0..10][-100..100]`
I somewhat agree with that. When using range slicing most combinations make sense:
```ruby
[*0..10][0..4] #first elements
...
Dan0042 (Daniel DeLorme)
06:08 PM Bug #16988 (Closed): Kernel.load loads file from current directory without '.' in path
Ruby allows to load files using ```Kernel.load``` without explicitly specifying the relative path with ```.``` I'm not sure it's a bug or a feature, but since documentation in master doesn't say anything about it and the behavior differs... TheSmartnik (Nikita Misharin)
04:22 PM Feature #16986: Anonymous Struct literal
Thinking a bit more about it, I see more of a conceptual problem.
Introducing new literal in a language, we kinda introduce a new concept of the core collection. But what's that collection is, how'd you explain it to a novice?
It i...
zverok (Victor Shepelev)
11:15 AM Feature #16986: Anonymous Struct literal
> Or yeah just a simple Struct() or Struct[] with no additional syntax as suggested just above.
Actually I just realized that it can't really work as it would allow for `**kwargs`.
byroot (Jean Boussier)
11:14 AM Feature #16986: Anonymous Struct literal
> Matz said he thought about {|a: 1, b: 2 |} syntax.
Might be just me but `{|` on first sight makes me think: this is a block.
What about a `%` syntax? `%s` and `%S` already exists, but `%O` could make sense: `%O{foo: 1, bar: 42}`....
byroot (Jean Boussier)
11:08 AM Feature #16986: Anonymous Struct literal
Another (unrelated, but conflicting) matter: I am not sure we have/had a discussion for this, but I remember Bozhidar Batsov in his "Ruby 4: To Infinity and Beyond" proposed `${}` as a literal for *set* (which for me seems more important... zverok (Victor Shepelev)
11:05 AM Feature #16986: Anonymous Struct literal
WDYT about half-solution (without syntax change)?
E.g. for me, the problem with `Struct.new(:a, :b).new(1, 2)` is not that it is "too long to write" but just that it is looks "hacky" (like, "you are using Struct against its expectation...
zverok (Victor Shepelev)
10:09 AM Feature #16986: Anonymous Struct literal
hi, I like this idea :)
I was wondering if `${}` can do the following things compared to Hash literals:
```ruby
# Can a value that is not a Symbol be used as a key (Symbol only?)
${ "a" => 1 }
${ 1 => 1 }
# Can variables be use...
osyo (manga osyo)
09:36 AM Feature #16986: Anonymous Struct literal
First, I like the idea, so +1 for the idea. It also reminds me of
a more "prototypic-based approach" in general with structs, so if
the syntax could be made simpler to type, that seems to be a
possible improvement. And it fits into othe...
shevegen (Robert A. Heiler)
06:58 AM Feature #16986 (Assigned): Anonymous Struct literal
# Abstract
How about introducing anonymous Struct literal such as `${a: 1, b: 2}`?
It is almost the same as `Struct.new(:a, :b).new(1, 2)`.
# Proposal
## Background
In many cases, people use hash objects to represent a set o...
ko1 (Koichi Sasada)
03:56 PM Bug #14541: Class variables have broken semantics, let's fix them
Since it's an error in 3.0, shouldn't it be made a non-verbose warning in 2.7? Dan0042 (Daniel DeLorme)
03:51 PM Feature #16897: General purpose memoizer in Ruby 3 with Ruby 2 performance
sam.saffron (Sam Saffron) wrote in #note-28:
> If we keep `foo(a: 1)` working a developer may get confused (despite everything operating 100% correctly):
> ...
I feel compelled to make a quick note here that what Sam is saying above is...
Dan0042 (Daniel DeLorme)
02:57 PM Feature #16987 (Closed): Enumerator::Lazy vs Array methods
Enumerations are designed to be greedy (immediately executed on each method call within a chain) by default. Sometimes, that is not useful for practical purposes (e.g. 2 mln strings array, drop comments, split into fields, find the first... zverok (Victor Shepelev)
02:15 PM Feature #16848: Allow callables in $LOAD_PATH
That's interesting...
My understanding was that the "find" and "load" operations were supposed to be orthogonal, so that we could have e.g.
1. find in:
* directory
* gems (cache)
* zip file
2. load:
* .rb
* .so
...
Dan0042 (Daniel DeLorme)
12:38 PM Feature #16746: Endless method definition
To add an "opinion perspective"... I, for one, even if not fascinated but at least intrigued by new syntax.
My reasoning is as follows:
* The most precious Ruby's quality for me is "expressiveness at the level of the single 'phrase...
zverok (Victor Shepelev)
09:51 AM Feature #16985: Improve `pp` for `Hash` and `String`
I don't have any big preference, but I tend to agree with sawa too.
When I first read the proposal, I was confused in that two suggestions seem to be combined - or at the least I was reading it that way.
(1) Display "foo: bar" rather t...
shevegen (Robert A. Heiler)
07:58 AM Feature #16985: Improve `pp` for `Hash` and `String`
I wish the hashrocket stays and the syntax is consistent without exceptions for symbol. vo.x (Vit Ondruch)
06:01 AM Feature #16985: Improve `pp` for `Hash` and `String`
shyouhei (Shyouhei Urabe) wrote in #note-4:
> There are lots of debatable points on String#inspect (for instance its return value depends on runtime locale, why?). Improving it can quite easily jump into a bikeshed. You might want to s...
sawa (Tsuyoshi Sawada)
02:01 AM Feature #16985: Improve `pp` for `Hash` and `String`
There are lots of debatable points on String#inspect (for instance its return value depends on runtime locale, why?). Improving it can quite easily jump into a bikeshed. You might want to separate Hash's and String's discussions and fo... shyouhei (Shyouhei Urabe)
01:44 AM Feature #16985: Improve `pp` for `Hash` and `String`
For `String`, I meant to say that current format would be kept the same except if the single quote version exist and has no escape.
```ruby
pp "Hello" # => "Hello" (no change)
pp "Won't\nwork \"Marc-André\"" # => "Won't\nwork \"Marc-And...
marcandre (Marc-Andre Lafortune)
08:40 AM Revision ad1ebefe (git): Avoid duplicated "when"s [ci skip]
k0kubun (Takashi Kokubun)
08:36 AM Revision a0aacd2e (git): Add a NEWS placeholder for disposable cc [ci skip]
asked by ko1 to put this. k0kubun (Takashi Kokubun)
08:33 AM Revision 200c5f40 (git): Add NEWS entries about JIT optimizations
and a related VM improvement.
JIT related commits:
* Code size reduction
* Deduplicate functions on JIT compaction 818d6d33368a396d9cd3d1a34a84015a9e76c5c8
* Avoid always inlining cold paths of ivar fcd257629063a345c48ff2d8057fa8ab...
k0kubun (Takashi Kokubun)
08:05 AM Revision 4949df49 (git): [ruby/fiddle] Fixed typos
https://github.com/ruby/fiddle/commit/a09e66adf4
https://github.com/ruby/fiddle/commit/6cab9b45d6
https://github.com/ruby/fiddle/commit/ab72b19bed
nobu (Nobuyoshi Nakada)
06:50 AM Revision 40b40523 (git): Show what's inlined first in "JIT inline" log
and add a debug log k0kubun (Takashi Kokubun)
06:33 AM Revision 7982dc1d (git): Decide JIT-ed insn based on cached cfunc
for opt_* insns.
opt_eq handles rb_obj_equal inside opt_eq, and all other cfunc is
handled by opt_send_without_block. Therefore we can't decide which insn
should be generated by checking whether it's cfunc cc or not.
```
$ benchmark-dr...
k0kubun (Takashi Kokubun)
05:21 AM Revision 9dbc2294 (git): Collect insns from a child process
to make sure :opt_invokebuiltin_delegate_leave doesn't become
:(trace_)opt_invokebuiltin_delegate.
This is to prevent a warning like
> /tmp/ruby/v3/src/trunk-test/test/ruby/test_jit.rb:618: warning:
'opt_invokebuiltin_delegate_leave' in...
k0kubun (Takashi Kokubun)
05:15 AM Revision a640bcee (git): test/ruby/test_settracefunc.rb: Suppress a warning
http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200626T033003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20200626T033003Z/ruby/test/ruby/test_settracefunc.rb:2299: warning: ambiguous first argument; put parentheses or...
mame (Yusuke Endoh)
05:11 AM Revision 5c03e468 (git): Try increasing read timeout of rinda tests
To prevent random failure with --jit-wait like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3026615
k0kubun (Takashi Kokubun)
01:21 AM Revision 8070cb56 (git): fix return event and opt_invokebuiltin_delegate_leave (#3256)
If :return event is specified for a opt_invokebuiltin_delegate_leave
and leave combination, the instructions should be
opt_invokebuiltin_delegate
trace_return
instructions. To make it, opt_invokebuiltin_delegate_leave
instruction wil...
ko1 (Koichi Sasada)

06/25/2020

10:42 PM Feature #16746: Endless method definition
Eregon (Benoit Daloze) wrote in #note-23:
> Noteworthy is the current syntax in trunk is `def name(*args) = expr` (and not `def: name`), so there is *no* visual cue that this is a endless method definition except the `=` which comes ver...
marcandre (Marc-Andre Lafortune)
09:36 PM Feature #16746: Endless method definition
Noteworthy is the current syntax in trunk is `def name(*args) = expr` (and not `def: name`), so there is *no* visual cue that this is a endless method definition except the `=` which comes very late.
I agree with @marcandre, I think it ...
Eregon (Benoit Daloze)
06:46 PM Feature #16746: Endless method definition
tldnr; I am against this proposal, it decreases readability, increases complexity and doesn't bring anything to the table (in that order)
I read the thread carefully and couldn't find a statement of what is the intended gain.
@matz, co...
marcandre (Marc-Andre Lafortune)
10:04 PM Feature #16985: Improve `pp` for `Hash` and `String`
I think `symbol_key: value` would be nice in Hash#inspect, even if there are also non-Symbol keys.
I think changing String#inspect might be confusing, I'm used to see Strings always starting with a `"` for `p string`.
Eregon (Benoit Daloze)
05:28 PM Feature #16985 (Assigned): Improve `pp` for `Hash` and `String`
Could we improve `pp` for `Hash` and `String`:
```ruby
pp({hello: 'My name is "Marc-André"'})
# =>
{hello: 'My name is "Marc-André"'}
# instead of
{:hello=>"My name is \"Marc-André\""}
```
If any key is non-symbol, they woul...
marcandre (Marc-Andre Lafortune)
06:23 PM Feature #16147: List Comprehensions in Ruby
In my opinion, the more useful types of list comprehensions are when multiple inputs are needed.
The Ruby syntax in example one looks best, but requires more array manipulation, even if Enumerable#filter_map replaces select.map. Example...
emptyflask (Jon Roberts)
03:21 PM Revision 289a28e6 (git): * 2020-06-26 [ci skip]
git[bot]
03:21 PM Revision 2d89af45 (git): Add require to Delegator examples
In Ruby 2.7.1 SimpeDelegator cannot be used without requiring `delegate` this PR adds the require to the first example for each class so that devs don't have to hunt for what require to use. Richard Schneeman
12:39 PM Bug #16492: TestBugReporter#test_bug_reporter_add test failures
Digging a bit into this issue, I was wrong that this is just s390x.
~~~
for i in {1..10000}
do
echo "******** $i"
make runruby TESTRUN_SCRIPT="-Itool/lib test/-ext-/bug_reporter/test_bug_reporter.rb -v"
done
... snip ......
vo.x (Vit Ondruch)
09:21 AM Revision 6fdd5e26 (git): Removed duplicate target
While `spec/bundler` and `spec/bundler/` are treated different
targets by GNU make 4, the same target by GNU make 3. The latter
target, ending with a slash, was to run `test-bundler-parallel`,
instead of `spec/bundler/%`.
nobu (Nobuyoshi Nakada)
08:09 AM Feature #16897: General purpose memoizer in Ruby 3 with Ruby 2 performance
Understood Jeremy, there are always compromises.
```
def bar(a:); end
def foo(*args); bar(*args); end;
```
There was a deliberate decision made to break `foo(a: 1)` here (by default) which has both its upsides and downsides.
...
sam.saffron (Sam Saffron)
06:44 AM Revision 9a78e24f (git): Removed nonsense `rubygems_version` in input gemspec files
As it is ignored and set at building packages automatically, it is
just nonsense to set in gemspec file for input.
nobu (Nobuyoshi Nakada)
06:32 AM Revision 4eff8a66 (git): [flori/json] add metadata
https://github.com/flori/json/commit/9f430a7bba noraj (Alexandre ZANNI)
06:32 AM Revision 1b076ca3 (git): [flori/json] Gem::Specification#date is set automatically by RubyGems.org.
https://github.com/flori/json/commit/1920653013 hsbt (Hiroshi SHIBATA)
06:32 AM Revision 4dbb10f2 (git): [flori/json] keyword argument is provided after Ruby 2.0+
https://github.com/flori/json/commit/78ec5e2bd3 hsbt (Hiroshi SHIBATA)
05:59 AM Revision bb4a2351 (git): Do not JIT inline builtin methods
It's probably not worth it because there's nothing we can optimize in
such builtin methods. It's worth JIT only when inlined.
k0kubun (Takashi Kokubun)
05:43 AM Revision ab62aa70 (git): Run a TracePoint test in an insolated process
to prevent a random failure like
http://ci.rvm.jp/results/trunk-random2@phosphorus-docker/3024287
k0kubun (Takashi Kokubun)
01:03 AM Feature #16984 (Closed): Remove write barrier exemption for T_ICLASS
Currently, iclasses are "shady", or not protected by write
barriers. Because of that, the GC needs to spend more time marking these
objects than otherwise. Let's insert write barriers for iclasses.
Applications that use modules heav...
alanwu (Alan Wu)
12:01 AM Bug #16977: Ambiguous lookup super for refinements
ssnickolay (Nikolay Sverchkov) wrote:
> [In specification](https://docs.ruby-lang.org/en/2.7.0/syntax/refinements_rdoc.html) we have the note
> ...
(snip)
> I don’t understand why `include` works differently than refining a method dir...
shugo (Shugo Maeda)

06/24/2020

06:31 PM Revision 5e860ed4 (git): [ci skip] Enhanced RDoc for Array (#3252)
Methods:
map/collect
map!/collect!
values_at
select/filter
select!/filter!
burdettelamar (Burdette Lamar)
04:14 PM Revision 3d8705dc (git): Drop token info for endless method definition
Because it does not have closing `end`. nobu (Nobuyoshi Nakada)
04:14 PM Revision 419b0596 (git): [ripper] added endless method definition event tests
nobu (Nobuyoshi Nakada)
03:20 PM Revision 5dfe95d1 (git): * 2020-06-25 [ci skip]
git[bot]
03:14 PM Revision fe82f729 (git): AST.of needs SCRIPT_LINES__ filled with a newline
nobu (Nobuyoshi Nakada)
01:02 PM Bug #16904 (Closed): rubygems: psych: superclass mismatch for class Mark (TypeError)
vo.x (Vit Ondruch)
01:01 PM Bug #16904: rubygems: psych: superclass mismatch for class Mark (TypeError)
This was fixed in master:
https://github.com/ruby/ruby/commit/a18e81d797135de6e143a600e4f4d2b00ab23bf9
https://github.com/ruby/ruby/commit/5aa5aad48aa3effce60de3559d9bd107bfc9a91d
https://github.com/ruby/ruby/commit/07dca5c02c95322a...
vo.x (Vit Ondruch)
12:34 PM Bug #16904: rubygems: psych: superclass mismatch for class Mark (TypeError)
Is it possible to do backport the fixes to Ruby 2.7?
For Fedora Ruby, we applied the following 4 patches (merged pull-requests) to fix this issue in Fedora.
https://github.com/rubygems/rubygems/pull/3124
https://github.com/rubygem...
jaruga (Jun Aruga)
12:57 PM Bug #16983 (Closed): RubyVM::AbstractSyntaxTree.of(method) returns meaningless node if the method is defined in eval

# Problem
`RubyVM::AST.of(method)` returns a meaningless node if the method is defined in eval.
For example:
```ruby
p 'blah'
eval <<~RUBY, binding, __FILE__, __LINE__ + 1
def foo
end
RUBY
method = method(:foo)
...
pocke (Masataka Kuwabara)
12:20 PM Bug #16982 (Closed): Define instance_methods and so on explicitly on classes generated by DelegateClass
I found two problems with `DelegateClass`.
The patch is available on GitHub. https://github.com/ruby/ruby/pull/3221
# `instance_methods`
First, `instance_methods` method's result does not contain the names of methods that are adde...
pocke (Masataka Kuwabara)
11:01 AM Bug #16981 (Closed): [ripper] mismatched indentations warning has disappeared since 2.6
Applied in changeset commit:git|263b941321c3de6afc8f9dafbc2625f866b7437e.
----------
[ripper] fix mismatched indentations warning [Bug #16981]
The scanner location has to be set from `lex.ptok` before it is
flushed by dispatching the s...
nobu (Nobuyoshi Nakada)
10:47 AM Bug #16981 (Closed): [ripper] mismatched indentations warning has disappeared since 2.6
```
$ ruby2.5 -v -rripper -e 'r = Ripper.new("begin\n end"); def r.warn(*e) p e; end; r.parse'
ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-darwin19]
["mismatched indentations at '%s' with '%s' at %d", "end", "begin", 1]
$ r...
nobu (Nobuyoshi Nakada)
10:53 AM Revision 263b9413 (git): [ripper] fix mismatched indentations warning [Bug #16981]
The scanner location has to be set from `lex.ptok` before it is
flushed by dispatching the scanner event.
nobu (Nobuyoshi Nakada)
10:52 AM Revision 7f29e34f (git): [ripper] fail unless got warning as expected
nobu (Nobuyoshi Nakada)
07:29 AM Revision 50c63ab3 (git): Fix a random test failure by TracePoint
A test worker process may already be enabling TracePoint, which results
in changing the insn name in this test.
http://ci.rvm.jp/results/trunk-random0@phosphorus-docker/3022750
k0kubun (Takashi Kokubun)
06:57 AM Revision 737da8d3 (git): Add another missing cast
k0kubun (Takashi Kokubun)
06:56 AM Revision e0037997 (git): Include workflow name in a notification of Compilations
k0kubun (Takashi Kokubun)
06:50 AM Revision 6ecef119 (git): Add missing cast
k0kubun (Takashi Kokubun)
06:49 AM Revision 946e5cc6 (git): Annotate Kernel#class as inline (#3250)
```
$ benchmark-driver -v --rbenv 'before;after;before --jit;after --jit' benchmark/mjit_class.yml --repeat-count=4
before: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) [x86_64-linux]
after: ruby 2.8.0dev (2020-06-23T17:29:56Z ...
k0kubun (Takashi Kokubun)
06:42 AM Revision 3e02cd51 (git): Trace :return of builtin methods
using opt_invokebuiltin_delegate_leave insn.
Since Ruby 2.7, :return of methods using builtin have not been traced properly.
k0kubun (Takashi Kokubun)
06:18 AM Revision fbb32b1f (git): * 2020-06-24 [ci skip]
git[bot]
06:17 AM Revision b71047cc (git): Fix RubyVM::AbstractSyntaxTree document
RubyVM::AbstractSyntaxTree is a module actually, but the document says "class". pocke (Masataka Kuwabara)
12:53 AM Bug #16979: FileUtils#cp_r with preserve, lchmod fails with ENOTSUPP
I guess this is already fixed in changeset commit:a19228f878d955eaf2cce086bcf53f46fdf894b9 shyouhei (Shyouhei Urabe)

06/23/2020

11:00 PM Bug #16759: MinGW 2.5 - SEGV bug with Binding#local_variable_set
Ping.
This still happens and is annoying as it fails consistently in ruby/spec's CI (e.g., https://github.com/ruby/spec/pull/774).
I will now exclude it there, but the bug is still present.
Eregon (Benoit Daloze)
06:04 PM Misc #16980 (Closed): Improve documentation on JSON#parse and JSON#parse!
Adds information about raised error when fails to parse on JSON#parse and JSON#parse! bruno.gomes (Bruno Gomes da Silva)
03:49 PM Feature #16897: General purpose memoizer in Ruby 3 with Ruby 2 performance
sam.saffron (Sam Saffron) wrote in #note-26:
> > In terms of usability, matz seems to like handling *args, **kwargs because it is explicit and not so complex.
> ...
The alternative is breaking compatibility with code that never used k...
jeremyevans0 (Jeremy Evans)
05:00 AM Feature #16897: General purpose memoizer in Ruby 3 with Ruby 2 performance
> In terms of usability, matz seems to like handling *args, **kwargs because it is explicit and not so complex.
To me the design we arrived at is very very non-intuitive sadly, @matz
```
def bar(a: 1)
end
def foo(*x)
puts...
sam.saffron (Sam Saffron)
03:34 PM Bug #16979 (Closed): FileUtils#cp_r with preserve, lchmod fails with ENOTSUPP

Hello,
I encountered an issue copying a directory tree with symlinks with FileUtils#cp_r with preserve flag.
Apparently FileUtils considers the possibility that lchmod raises NotImplementedError, however it apparently does not bu...
vihai (Daniele Orlandi)
01:58 PM Revision dc351ff9 (git): [ci skip] Enhanced RDoc for Array (#3237)
Methods:
#rotate!
#rotate
#sort!
#sort
#bsearch
#bsearch_index
burdettelamar (Burdette Lamar)
09:49 AM Feature #16891: Restore Positional Argument to Keyword Conversion
I think even just doing the first one, "Positional Hash Argument to Keyword Argument Conversion", is only going to make everything more confusing and delay migration.
In other words, I think there will be far more pain points that way th...
Eregon (Benoit Daloze)
07:29 AM Feature #16978 (Assigned): Ruby should not use realpath for __FILE__
This is the simplest test case:
~~~
$ mkdir a
$ echo "puts __FILE__" > a/test.rb
$ ln -s a b
$ ruby -Ib -e "require 'test'"
/builddir/a/test.rb
~~~
This behavior is problematic, because Ruby should not know nothing abou...
vo.x (Vit Ondruch)
07:09 AM Revision 37a2e48d (git): Avoid generating opt_send with cfunc cc with JIT
only for opt_nil_p and opt_not.
While vm_method_cfunc_is is used for opt_eq too, many fast paths of it
don't call it. So if it's populated, it should generate opt_send,
regardless of cfunc or not. And again, opt_neq isn't relevant due t...
k0kubun (Takashi Kokubun)
06:56 AM Revision 6aa3aaac (git): lldb_cruby.py: show the sign of Bignum [ci skip]
nobu (Nobuyoshi Nakada)
06:26 AM Revision 078e9410 (git): [ruby/psych] Fixup 05d7e818a6abe3ee1c56b6be92f086647d73141c
https://github.com/ruby/psych/commit/4e7794fc2c hsbt (Hiroshi SHIBATA)
06:26 AM Revision 7cdfc2b5 (git): [ruby/psych] Bump version strings for header file
https://github.com/ruby/psych/commit/68da645c7e hsbt (Hiroshi SHIBATA)
06:26 AM Revision 70a45998 (git): [ruby/psych] Bump libyaml version to 0.2.5
https://github.com/ruby/psych/commit/39996192cc hsbt (Hiroshi SHIBATA)
06:26 AM Revision 666c0776 (git): [ruby/psych] Fix anchor lookup with symbolized names
https://github.com/ruby/psych/commit/ef74fc01e2 byroot (Jean Boussier)
06:05 AM Revision e9adc2f4 (git): Match the output without encoding for localized compilers
nobu (Nobuyoshi Nakada)
02:58 AM Feature #16470: Issue with nanoseconds in Time#inspect
Interesting, I can reproduce the performance difference:
```
$ time ./miniruby -e '100000.times { Time.utc(2007, 11, 1, 15, 25, 0, 123456.789.to_r) }'
real 0m0.633s
user 0m0.622s
sys 0m0.011s
$ time ./miniruby -e '1...
mame (Yusuke Endoh)
01:01 AM Revision 9ce20662 (git): Improved error messages for mjit option
and default jit-verbose to 1 if no argument. nobu (Nobuyoshi Nakada)
01:01 AM Revision c3ba2db4 (git): Removed execpath argument of path_check_0 as always TRUE now
nobu (Nobuyoshi Nakada)
01:01 AM Revision 61374839 (git): Removed fpath_check, no longer used since taint flag was removed
nobu (Nobuyoshi Nakada)

06/22/2020

11:27 PM Revision e2d94f61 (git): Convert RMoved to a doubly linked list
This commit converts RMoved slots to a doubly linked list. I want to
convert this to a doubly linked list because the read barrier (currently
in development) must remove nodes from the moved list sometimes.
Removing nodes from the list i...
tenderlovemaking (Aaron Patterson)
06:33 PM Bug #16977 (Closed): Ambiguous lookup super for refinements
[In specification](https://docs.ruby-lang.org/en/2.7.0/syntax/refinements_rdoc.html) we have the note
> Note that super in a method of a refinement invokes the method in the refined class even if there is another refinement which has ...
ssnickolay (Nikolay Sverchkov)
06:05 PM Feature #16470: Issue with nanoseconds in Time#inspect
Eregon (Benoit Daloze) wrote in #note-9:
> One consideration here is performance.
> ...
Well, Time converts Float to Rational both with and without the patch (the values are passed through `num_exact`, which is where the conversion tak...
jeremyevans0 (Jeremy Evans)
05:24 PM Feature #16470: Issue with nanoseconds in Time#inspect
One consideration here is performance.
For instance `Time.at(Float)` is quite slow, due to going through Rational, etc.
Could you measure the other methods you changed to see how they perform compared to before?
Eregon (Benoit Daloze)
03:55 PM Feature #16470: Issue with nanoseconds in Time#inspect
I've added an alternative approach, which uses Float#rationalize for all Float conversions in Time, except for Time.at (one test depends on `Time.at(float).to_f == float`): https://github.com/ruby/ruby/pull/3248 jeremyevans0 (Jeremy Evans)
05:45 PM Revision 574a4f02 (git): Skip test_read_body_block_mod for --jit-wait
k0kubun (Takashi Kokubun)
04:42 PM Bug #16976 (Closed): Documentation bug in Proc
This was fixed earlier in commit:39a1959d289ecba5e61431deaef239123c3f0fcc. I don't consider it worth backporting. jeremyevans0 (Jeremy Evans)
04:40 PM Bug #16976: Documentation bug in Proc
Thanks for the report! I'll fix the documentation shortly. jeremyevans0 (Jeremy Evans)
04:27 PM Bug #16976 (Closed): Documentation bug in Proc
https://ruby-doc.org/core-2.7.0/Proc.html
About 1/3 of the way through the docs, it states:
Lambda semantics is typically preserved during the proc lifetime, including &-deconstruction to a block of code:
``` ruby
p = proc {|x,...
kwerle (Kurt Werle)
03:31 PM Revision 079ed74d (git): * 2020-06-23 [ci skip]
git[bot]
03:25 PM Revision ec9a9aaa (git): Ignore configurations in un-built extension libraries
Exclude linker flags for external libraries used by no longer
built extension libraries when static-linked-ext.
nobu (Nobuyoshi Nakada)
02:55 PM Feature #16972: Pathname#mkpath to accept block to call on each created directory
Thanks for the tip; all these years and I never realized `FileUtils.mkdir_p` had this `mode:` argument (and/or never realized what it was for).
I can _imagine_ use cases for this generic solution: chown, chgrp, touch index.html
And in ge...
Dan0042 (Daniel DeLorme)
02:08 PM Bug #16973: Rails Active Support unit test fails since 41582d5866
Opened a pull request at Rails https://github.com/rails/rails/pull/39697 Thank you for the useful information. yahonda (Yasuo Honda)
09:34 AM Revision 6adbdb56 (git): Fix Encoding::CompatibilityError in `FileUtils::Entry_#join`
znz (Kazuhiro NISHIYAMA)
09:23 AM Revision 3a1e63e5 (git): Fix typos
znz (Kazuhiro NISHIYAMA)
09:18 AM Revision 7ac6c967 (git): Revert d231b8f95b35d8a344cec4f62d7bbdf360a70e1c and add debug print
znz (Kazuhiro NISHIYAMA)
09:13 AM Feature #16975: Warn when value from environment is being ignored by `Dir.tmpdir`
@nobu You are totally right, I misread the code. What we would need is indeed to split the following conditions. deivid (David Rodríguez)
04:08 AM Feature #16975: Warn when value from environment is being ignored by `Dir.tmpdir`
I think it would be acceptable.
That "silent rescue" is actually for `File.stat` only, that is an obvious case.
I guess you may want to split the following conditions.
nobu (Nobuyoshi Nakada)
09:08 AM Revision 78352fb5 (git): Compile opt_send for opt_* only when cc has ISeq
because opt_nil/opt_not/opt_eq populates cc even when it doesn't
fallback to opt_send_without_block because of vm_method_cfunc_is.
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' benchmark/mjit_opt_cc_insns.yml --repeat-cou...
k0kubun (Takashi Kokubun)
08:37 AM Revision 32386417 (git): Use filesystem encoding for file path only
`path_info` contains filesystem encoding and binary.
Example is `"/webrick.cgi/%A5%DB%A4%B2/%A4%DB%A4%B2"` in `TestWEBrickCGI#test_cgi`.
znz (Kazuhiro NISHIYAMA)
08:31 AM Revision 61743f0c (git): Add tests of nested multibyte path and DirectoryIndex
znz (Kazuhiro NISHIYAMA)
08:11 AM Revision d231b8f9 (git): Fix remove_entry error when path encoding is not compatible UTF-8
znz (Kazuhiro NISHIYAMA)
08:11 AM Revision 48d7ebe6 (git): Check symlink in tmpdir and do not use empty path
znz (Kazuhiro NISHIYAMA)
07:54 AM Revision 4c5780e5 (git): Share warmup logic across MJIT benchmarks
k0kubun (Takashi Kokubun)
07:20 AM Revision faf93e45 (git): The RUBYOPT= comment is no longer needed
k0kubun (Takashi Kokubun)
07:17 AM Revision 8838600c (git): Stop relying on `make benchmark`'s `-I$(srcdir)/benchmark/lib`
These days I don't use `make benchmark`. The YAML files should be
executable with bare `benchmark-driver` CLI without passing
`RUBYOPT=-Ibenchmark/lib`.
k0kubun (Takashi Kokubun)
06:21 AM Revision 7658a0f8 (git): Try increasing read_timeout a little more
It failed again
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3018488
k0kubun (Takashi Kokubun)

06/21/2020

11:16 PM Revision eed4aaa0 (git): Increase read_timeout for --jit-wait
This tries to fix a random failure like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3017837
k0kubun (Takashi Kokubun)
09:19 PM Revision 54ad2bd6 (git): Use canary cond also if not VM_CHECK_MODE to suppress warnings
nobu (Nobuyoshi Nakada)
05:27 PM Revision 0e3ead34 (git): * 2020-06-22 [ci skip]
git[bot]
05:27 PM Revision d9f608b6 (git): Verify builtin inline annotation with VM_CHECK_MODE (#3244)
* Verify builtin inline annotation with VM_CHECK_MODE
* Remove static to fix the link issue on MJIT
k0kubun (Takashi Kokubun)
02:22 PM Feature #16975 (Closed): Warn when value from environment is being ignored by `Dir.tmpdir`
Currently, if you set `ENV["TMPDIR"]` to a value that doesn't meet `Dir.tmpdir` criteria to become the temporary folder, the environment variable is silently ignored and the next variable in the chain is checked.
This makes issues qui...
deivid (David Rodríguez)
02:14 PM Revision aec8e6d3 (git): test/ruby/test_jit.rb: Change the condition to detect RHEL 7.1 s390x
mame (Yusuke Endoh)
12:04 PM Bug #16974 (Closed): frozen string issue in lib/reline/ansi.rb on ruby-2.7.1
`RUBYOPT=--enable-frozen-string irb` throws a `/Users/user/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/reline/ansi.rb:109:in `block in cursor_pos': can't modify frozen String: "" (FrozenError)`. Have created a PR to fix this here - https://git... ritikesh (Ritikesh G)
09:54 AM Feature #16254: MRI internal: Define built-in classes in Ruby with `__intrinsic__` syntax
Great to see `Primitive.name` is used now :)
Somehow Redmine didn't send me any notification for the issue being closed.
@k0kubun agreed for the first one.
Eregon (Benoit Daloze)
08:47 AM Feature #16254: MRI internal: Define built-in classes in Ruby with `__intrinsic__` syntax
I have no preference on whether it should be called "primitive" or "builtin", but can we at least make the naming consistent? The `Primitive` change introduced naming inconsistency inside CRuby and it's causing cognitive overhead when re... k0kubun (Takashi Kokubun)
09:14 AM Revision ec07e2de (git): Increase read timeout of FTP tests with --jit-wait
Trying to eliminate some newer random failures
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3016543
k0kubun (Takashi Kokubun)
07:34 AM Revision 426db4cd (git): Fix -Wmaybe-uninitialized at vm_invoke_block
k0kubun (Takashi Kokubun)
07:16 AM Revision 995923b7 (git): [DOC] Mentioned that `Time.parse` method is not validator
nobu (Nobuyoshi Nakada)
07:16 AM Revision 956d1872 (git): [ruby/date] [DOC] Mentioned alternative `strptime` methods
https://github.com/ruby/date/commit/5f4ac92947 nobu (Nobuyoshi Nakada)
07:16 AM Revision 67e544cb (git): [ruby/date] [DOC] Emphasized that `parse` methods are not validators
https://github.com/ruby/date/commit/81a057db11 nobu (Nobuyoshi Nakada)
06:25 AM Revision 538276aa (git): Skip a test_jit with builtin for rhel_zlinux
Either 95b0fed371 or 7561db8c00 started to cause
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20200621T053303Z.fail.html.gz
But so far no idea why it's happening. Until I get direct ssh access to
debug the...
k0kubun (Takashi Kokubun)
02:31 AM Revision ccd2f99e (git): Prefer more descriptive assertion methods
nobu (Nobuyoshi Nakada)
01:34 AM Revision 838d695c (git): Prefer ruby_install_name as runner
`Gem::Commands::EnvironmentCommand` expects that `Gem.ruby` has
the transformed basename.
nobu (Nobuyoshi Nakada)
01:12 AM Bug #16973 (Third Party's Issue): Rails Active Support unit test fails since 41582d5866
yuki24 (Yuki Nishijima) wrote in #note-4:
> Not sure if this is helpful but here is a link to the place where `ActiveSupport::ToJsonWithActiveSupportEncoder` is prepended on a number of classes: https://github.com/rails/rails/blob/0b9a5...
jeremyevans0 (Jeremy Evans)
12:13 AM Feature #15589 (Closed): `Numeric#zero?` is much slower than `== 0`
Applied in changeset commit:git|7561db8c009bb79a75024fa4ed0350bfb3d0626c.
----------
Introduce Primitive.attr! to annotate 'inline' (#3242)
[Feature #15589]
k0kubun (Takashi Kokubun)
12:13 AM Revision 7561db8c (git): Introduce Primitive.attr! to annotate 'inline' (#3242)
[Feature #15589] k0kubun (Takashi Kokubun)
 

Also available in: Atom