Geth rakudo/post-inc-dec-opt: a4f1f243ce | (Zoffix Znet)++ | t/packages/Test/Helpers/QAST.pm6
Implement Test::Helpers::QAST private test helpers

These let us examine chunks of QAST and test whether or not a particular optimization has been applied.
01:01
rakudo/post-inc-dec-opt: 13e6ed8ce1 | (Zoffix Znet)++ | src/Perl6/Optimizer.nqp
Fix up native type post-dec to pre- optimization
01:46
rakudo/post-inc-dec-opt: 888328ef6a | (Zoffix Znet)++ | t/08-performance/02-qast-rewrites.t
Test native postinc/dec is opted to NQP ops
AlexDaniel ⚠ new bot! irclog.perlgeek.de/perl6/2018-02-07#i_15786705 02:24
Geth rakudo/post-inc-dec-opt: 971d17c43f | (Zoffix Znet)++ | src/Perl6/Optimizer.nqp
Add commented out opt for post-to-pre inc/dec conversion

For some reason prefix is slower than postfix in both void and non-void context. I opened that as
  github.com/rakudo/rakudo/issues/1491
03:10
rakudo: zoffixznet++ created pull request #1492:
Post inc dec opt
rakudo/master: 6 commits pushed by (Zoffix Znet)++
roast: zoffixznet++ created pull request #386:
Test post-inc/dec op optimization does not affect custom ops
03:12
roast: 9bcee77ff7 | (Zoffix Znet)++ | S06-operator-overloading/prefix.t
Test post-inc/dec op optimization does not affect custom ops

Closes github.com/rakudo/rakudo/issues/1477 Closes github.com/rakudo/rakudo/issues/1315
roast: c2be214cb7 | (Zoffix Znet)++ (committed using GitHub Web editor) | S06-operator-overloading/prefix.t
Merge pull request #386 from perl6/post-inc-dec-opt

Test post-inc/dec op optimization does not affect custom ops
TimToady we really need to establish a mechanism for declaring you want to follow the policy of the underlying operator 03:13
yoleaux 6 Feb 2018 18:41Z <Zoffix> TimToady: What's your opinion on allowing multi-arg HyperWhatevers? `(** + **)(1, 2, 3, 4)` to mean `(1, 2, 3, 4).flat.map: * + *`. Basically the double-asterisks are used anywhere an arg is to be placed into, just like with normal Whatevers, and they're mapped N-at-a-time
TimToady not just assume that it's either the same or different 03:14
what if the custom ops *want* the optimization?
I'd have to think more about the HyperWhatevers, since their original intent was to express multidimensional notions, not just extra args 03:16
Zoffix TimToady: traits are compile time right? How about enable optimization by default and have users opt out of it for custom ops with `is not-optimized` trait? 03:18
TimToady so the question arises whether each ** should express another dimension, or whether it makes sense to allow on one extra dimension (the map list, here)
not-optimized is overly specific 03:19
different operators have different policies, and optimization is only one of the things those policies can affect
possibly to override we merely make the user declare their own proto that doesn't carry the policy 03:20
though that also has the downside if you want the originals multied in with different policies 03:21
the most common underlying policy currently is "is pure" 03:22
(I suspect)
Geth roast: 2f76cca07b | (Zoffix Znet)++ (committed using GitHub Web editor) | S06-operator-overloading/prefix.t
Mark custom op non-optimization for 6.d review

It's questionable: irclog.perlgeek.de/perl6-dev/2018-...i_15786958
03:25
TimToady m: multi sub infix:<+>($a,$b) is pure { say "$a $b" }; my $a = 1 + 2; BEGIN say "done"
camelia done
TimToady m: multi sub infix:<+>($a,$b) is pure(0) { say "$a $b" }; my $a = 1 + 2; BEGIN say "done"
camelia done
TimToady hmm
dinner &
Zoffix & bed 03:27
P.S.: `is pure` stuff is compiled in the optimizer, so it's later than BEGIN 03:29
m: sub infix:<+>($a,$b) is pure { say "$a $b" }; my $a = 1 + 2; BEGIN say "done"; INIT say "meow"
camelia done
1 2
meow
Zoffix m: sub infix:<+>($a,$b) { say "$a $b" }; my $a = 1 + 2; BEGIN say "done"; INIT say "meow"
camelia done
meow
1 2
[Tux] Rakudo version 2018.01-128-gd4712ab9c - MoarVM version 2018.01-77-g9a029b408
csv-ip5xs0.804 - 0.849
csv-ip5xs-207.528 - 8.110
csv-parser11.310 - 11.921
csv-test-xs-200.470 - 0.484
test9.151 - 9.365
test-t2.635 - 2.639
test-t --race1.082 - 1.087
test-t-2046.362 - 48.193
test-t-20 --race16.258 - 16.707
07:46
Geth rakudo: 2847e509d8 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Fix WhateverCode block migrator

Fixes github.com/rakudo/rakudo/issues/1487
When we migrate the things from a WhateverCode and disable the old block, be sure to empty out its declarations. Otherwise, we can end up with duplicated QAST::Blocks in two places, which was causing the bug.
10:45
roast: 00c4d36a67 | (Zoffix Znet)++ | S02-types/whatever.t
Test whatever curry + regex + methodcall

Closes github.com/rakudo/rakudo/issues/1487 Rakudo fix: github.com/rakudo/rakudo/commit/2847e509d8
10:46
samcv releasable6: status 11:16
releasable6 samcv, Next release in 10 days and ≈7 hours. Blockers: github.com/rakudo/rakudo/issues?q=...%9A%A0%22. Changelog for this release was not started yet
samcv, Details: gist.github.com/91f9f6126f363633d5...650ab7bbac
Geth rakudo: jstuder-gh++ created pull request #1494:
Separate adding child block from creating code obj
13:55
Zoffix Looking at the impl of p6sink op, it checks if the object nqp::can call .sink before calling it: github.com/rakudo/rakudo/blob/mast...s.nqp#L343 14:06
So I ripped out method sink from Mu and Nil and `my $i = 1; for ^1000_000 { $i++; $i++; $i++; $i++; $i++; $i++; Nil }; say now - INIT now` comes out at 8% faster 14:07
jnthn I wonder what we run into if we rip out the can 14:09
Hm, probably quite a lot :S 14:10
Zoffix First attempt to compile fails with "Method 'sink' not found for invocant of class 'IterationBuffer'"
jnthn oh heck, 'cus it'll be guarding bootstrap stuff too I guess
Zoffix and adding method sink to src/core/IterationBuffer.pm didn't help it 14:13
hm, `nqp::istype($foo, Mu)` comes out 60% faster than nqp::can($foo, 'sink'), but I guess there's no way to tell `src/vm/moar/Perl6/Ops.nqp` what the `Mu` type is, eh? 14:24
prolly won't be a big win anyway, 30M iterations complete in 3s 14:25
Zoffix &
Geth roast: dogbert17++ created pull request #387:
Add tests for RT #126703
14:29
synopsebot RT#126703 [open]: rt.perl.org/Ticket/Display.html?id=126703 Typed Shaped Arrays can't be initialized
Geth roast: 08061255e7 | (Jan-Olof Hendig)++ | S09-multidim/assign.t
Add tests for RT #126703
14:30
roast: 0f07adc7fb | (Zoffix Znet)++ (committed using GitHub Web editor) | S09-multidim/assign.t
Merge pull request #387 from dogbert17/test-rt-126703

Add tests for RT #126703
rakudo: 5bde60f5b5 | (Jeremy Studer)++ | 2 files
Separate adding child block from creating code obj

Previously, the create_simple_code_object method in the Perl6 World would add the block passed to it to the desired outer block in addition to returning a code object for it. From the name, it is not clear that the method has such side-effects. Separating the actions in order to make it explicit that we performing both of these.
14:49
rakudo: 06f34a0630 | (Jeremy Studer)++ | 2 files
Change name of code obj method

Change the name of the code object method instead so as not to incur the cost of an additional World method lookup.
rakudo: 4219f8ccf6 | (Zoffix Znet)++ (committed using GitHub Web editor) | 2 files
Merge pull request #1494 from jstuder-gh/sep_code_obj_actions

Separate adding child block from creating code obj
japhb Zoffix, ISTR there are nqp:: ops whose sole purpose is to pass an HLL type to lower layers -- that might be worth looking at for your sink optimization work. 15:17
*as a mechanism for
Geth rakudo: jstuder-gh++ created pull request #1495:
Remove extra push of child to outer block
15:18
rakudo: ba09db6719 | (Jeremy Studer)++ | src/Perl6/Actions.nqp
Remove extra push of child to outer block

The action should only occur once and already occurs in the method to create code objects. zoffix++ for verification.
15:23
rakudo: eac39b9246 | (Zoffix Znet)++ (committed using GitHub Web editor) | src/Perl6/Actions.nqp
Merge pull request #1495 from jstuder-gh/rm_extra_child_push

Remove extra push of child to outer block
AlexDaniel releasable6: next 15:42
releasable6 AlexDaniel, Next release in 10 days and ≈3 hours. Blockers: github.com/rakudo/rakudo/issues?q=...%9A%A0%22. Changelog for this release was not started yet
AlexDaniel, Details: gist.github.com/8cee98232d049ae2eb...95cc379995
jdv79 .seen ugexe 16:51
yoleaux I saw ugexe 23 Nov 2017 15:02Z in #perl6: <ugexe> I’m getting tired of it
AlexDaniel jdv79: IIRC ugexe is a little bit active on github 17:13
pmurias do we have a ticket for unrecognized unicode properties failing silently? 17:30
AlexDaniel pmurias: I don't remember one, but it's a known issue 17:32
pmurias: please file a ticket for it
pmurias AlexDaniel: github.com/rakudo/rakudo/issues/1496 17:38
AlexDaniel pmurias: thanks 17:54
Zoffix m: /{say 42}/ 18:17
camelia ( no output )
Zoffix ^ that block is actually mis-scoped. 18:18
Looks like all the regex blocks are miscoped (other than token/rule/regex as methods). And that's the cause of R#1481 too 18:19
synopsebot R#1481 [open]: github.com/rakudo/rakudo/issues/1481 `where` with regex miscopes QAST::Blocks inside the regex
Zoffix But I'm totally failing to write a migration predicate that compiles :S 18:20
Stage parse : Cannot find method 'blocktype' on object of type QAST::Op
at gen/moar/Perl6-Actions.nqp:827 (blib/Perl6/Actions.moarvm:block_immediate)
It crashes with that ^ because something is trying to access a migrated block as if it were in the original place (that QAST::Op is a nqp::null the block was replaced with)
Event tried a $BLOCK.annotate('in_regex', 1) if nqp::defined(%*RX); in method block and migrating only those. 18:21
hm, Plan B. Rake the regex QAST for anything with past_block annotation and migrate that instead 18:23
looks like that did the trick. 18:52
dogbert17 Zoffix: wrt R#1488, is it this you're looking for ? nqp::eqaddr(nqp::decont(a),nqp::decont(b)) 18:54
synopsebot R#1488 [open]: github.com/rakudo/rakudo/issues/1488 [LHF] multi sub infix:<cmp>(\a, \b) is missing decont
Zoffix dogbert17: yeah
There's probably more of such cases in the codebase
dogbert17 it passes spectest
how is it supposed to work: trying 'say Nil cmp $ = Nil' only gives a lot of complaints 18:56
the last part of the errmsg is 'Cannot modify an immutable Order (Same)' 18:57
Zoffix m: say Nil cmp $ = Nil
camelia Use of Nil in string context
in block <unit> at <tmp> line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> li…
Zoffix m: say Nil cmp ($ = Nil)
camelia Use of Nil in string context
Same
in block <unit> at <tmp> line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <…
Zoffix the last one ^
In working version there would not be any warnings. 18:58
I kinda think there shouldn't be any warnings if you `cmp` Nil cmp $whatever
dogbert17 then my fix is not correct since I get: Use of Nil in string context
in block <unit> at -e line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at -e line 1 18:59
Cannot modify an immutable Order (Same)
in block <unit> at -e line 1
Zoffix dogbert17: what code did you try?
dogbert17: to run
dogbert17 what you ran above
./perl6 -e 'say Nil cmp $ = Nil'
Zoffix I ran two different things. Your error suggest you tried the first one
./perl6 -e 'say Nil cmp ($ = Nil)' 19:00
Zoffix bbin30
dogbert17 Zoffix: dogbert@dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -e 'say Nil cmp ($ = Nil)' 19:01
Use of Nil in string context
in block <unit> at -e line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at -e line 1
Same
Zoffix s: &infix:<cmp>, \(Nil, Nil) 20:22
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/eac3...der.pm#L10
Zoffix m: sub infix:<cmp> (\a, \b) { nqp::eqaddr(a,b) ?? Same !! a.Stringy cmp b.Stringy }; say Nil cmp ($ = Nil) 20:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find nqp::eqaddr, did you forget 'use nqp;' ?
at <tmp>:1
------> 3 infix:<cmp> (\a, \b) { nqp::eqaddr(a,b)7⏏5 ?? Same !! a.Stringy cmp b.Stringy }; s
Zoffix m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(a,b) ?? Same !! a.Stringy cmp b.Stringy }; say Nil cmp ($ = Nil)
camelia Use of Nil in string context
Same
in sub infix:<cmp> at <tmp> line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in sub infix:<cmp…
Zoffix m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(nqp::decont(a),nqp::decont(b)) ?? Same !! a.Stringy cmp b.Stringy }; say Nil cmp ($ = Nil)
camelia Use of Nil in string context
Same
in sub infix:<cmp> at <tmp> line 1
Use of uninitialized value $ of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in sub infix:<cmp…
Zoffix m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(nqp::decont(a),nqp::decont(b)) }; say Nil cmp ($ = Nil)
camelia 0
Zoffix m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(nqp::decont(a),nqp::decont(b)) }; say Nil cmp (Nil) 20:24
camelia 1
Zoffix doesn't get it... Ohhh
dogbert17: sorry, it's a bogus sample code
( ($ = Nil) is an Any not Nil) 20:25
m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(nqp::decont(a),nqp::decont(b))?? Same !! a.Stringy cmp b.Stringy }; class Foo { method Stringy { die "no opt" } }; my $f := Foo.new; say $f cmp ($ = $f)
camelia Same
Zoffix m: use nqp; sub infix:<cmp> (\a, \b) { nqp::eqaddr(nqp::decont(a),b)?? Same !! a.Stringy cmp b.Stringy }; class Foo { method Stringy { die "no opt" } }; my $f := Foo.new; say $f cmp ($ = $f) 20:26
camelia no opt
in method Stringy at <tmp> line 1
in sub infix:<cmp> at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix m: use Test; { my class Foo { method Stringy { die "missed optimization" } }; my $f := Foo.new; is-deeply $f cmp ($ = $f), Same, 'eqaddr optimization for cmp exists' } 20:27
camelia missed optimization
in method Stringy at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix dogbert17: ^ that should pass when the fix is applied. And that could go into some new file inside github.com/rakudo/rakudo/tree/mast...rformance/ (99-misc.t or something)
ZOFVM: Files=1288, Tests=153196, 152 wallclock secs (21.47 usr 3.20 sys + 3244.01 cusr 171.16 csys = 3439.84 CPU) 20:43
hey cool... a passing todo \o/
dogbert17 Zoffix: thx, the test does indeed pass. I'll whip up a PR
Geth rakudo: c0c7756f4b | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Fix migration of in-regex blocks

Phixes github.com/rakudo/rakudo/issues/1481 Fixes RT#124998: rt.perl.org/Ticket/Display.html?id=124998
Looks like we never bothered to migrate blocks from regex into the QAST::Block made for the regex and the things worked simply ... (9 more lines)
20:49
synopsebot RT#124998 [open]: rt.perl.org/Ticket/Display.html?id=124998 [BUG] Type of $¢ is Any instead of Cursor
samcv who has the power to do a rebuild on appveyor? 20:50
Geth roast: d05a949255 | (Zoffix Znet)++ | S05-capture/match-object.t
Unfudge now-passing tests

Rakudo fix: github.com/rakudo/rakudo/commit/c0c7756f4b RT#124998: rt.perl.org/Ticket/Display.html?id=124998 RT#124999: rt.perl.org/Ticket/Display.html?id=124999
synopsebot RT#124999 [open]: rt.perl.org/Ticket/Display.html?id=124999 [BUG] Type of $¢ is Any instead of Cursor
dogbert17 Zoffix++ 20:51
samcv m: say $¢
camelia Nil
samcv what...
Geth roast: cec838d4c9 | (Zoffix Znet)++ | S05-metasyntax/regex.t
Test where with regex + block

Closes github.com/rakudo/rakudo/issues/1481 Rakudo fix: github.com/rakudo/rakudo/commit/c0c7756f4b
samcv why does th't work?
Zoffix It's special variable. Current Cursor or something 20:52
m: grammar { token TOP { { dd $¢ } . } }.parse: "x"
camelia Match.new(list => (), made => Any, pos => 0, hash => Map.new(()), orig => "x", from => 0)
samcv it's not on the docs page
should I open an issue? 20:53
i only find one usage in the docs and it doesn't explain what it means 20:54
it's just the output of some introspection
Geth rakudo: dogbert17++ created pull request #1498:
Fix R#1488 - multi sub infix:<cmp>(\a, \b) is missing decont. Zoffix++
20:57
synopsebot R#1488 [open]: github.com/rakudo/rakudo/issues/1488 [LHF] multi sub infix:<cmp>(\a, \b) is missing decont
Geth rakudo: 114e3735de | (Jan-Olof Hendig)++ | src/core/Order.pm
Fix R#1488 - multi sub infix:<cmp>(\a, \b) is missing decont. Zoffix++

Phixes: github.com/rakudo/rakudo/issues/1488
There's every chance that the codebase contains more problems like this.
21:11
synopsebot R#1488 [open]: github.com/rakudo/rakudo/issues/1488 [LHF] multi sub infix:<cmp>(\a, \b) is missing decont
rakudo: eca2bb999e | (Zoffix Znet)++ (committed using GitHub Web editor) | src/core/Order.pm
Merge pull request #1498 from dogbert17/fix-r1488

Fix R#1488 - multi sub infix:<cmp>(\a, \b) is missing decont. Zoffix++
AlexDaniel samcv: always thought that it is not supposed to be used by others, but I could be wrong 21:46
and if we want others to use it, then… is there an ascii equivalent? 21:47
I* 21:48
greppable6: \$¢ 21:50
greppable6 AlexDaniel, Sorry, can't do that
geekosaur afaik this only came up because zoffix suggested it as a predefined variable for code golf
AlexDaniel greppable6: \$\¢ 21:51
greppable6 AlexDaniel, Sorry, can't do that
AlexDaniel greppable6: ¢
greppable6 AlexDaniel, 19 lines, 9 modules: gist.github.com/504d778ef564a056e7...343843cfa3
AlexDaniel yea 21:52
jnthn My recollection is that $¢ was user-facing. The ASCII form is $/.CURSOR 22:31
Zoffix No, it came up right now because I closed a now-passing TODO for it. S09 talks about it. The $¢ and $/ start out the same in closures, but more matches are done in the closure, $¢ will remain the same, while $/ will be set to new match object. 22:37
$¢ is already ASCII
m: say '$¢'.ords
camelia (36 162)
Zoffix m: say '$¢'.ords».chr
camelia ($ ¢)
Zoffix m: grammar { token TOP { { dd $¢ === $/.CURSOR; "x" ~~ /x/; dd $¢ === $/.CURSOR } . } }.parse: "x" 22:38
camelia Bool::True
Bool::False
Zoffix S09:3123 22:39
synopsebot Link: design.perl6.org/S09.html#line_3123
Zoffix those anchors don't work in chrome...
jnthn No :( 22:40
MasterDuke nor in FF
jnthn And if I search for $¢ in that file I find nothing
Wait, S09?
S05:3123
synopsebot Link: design.perl6.org/S05.html#line_3123
Zoffix Oh, right lol
jnthn S09 isn't the regex one :P
Zoffix and now the anchor works :)
MasterDuke heh, now it works in FF 22:41
jnthn I suspect the exact relationship between $¢ and $/ maybe have evolved a bit in the Cursor/Match unification
I can't say I've ever used $¢ 22:42
Geth rakudo: dogbert17++ created pull request #1499:
Add test for R#1488
22:50
synopsebot R#1488 [open]: github.com/rakudo/rakudo/issues/1488 [LHF] multi sub infix:<cmp>(\a, \b) is missing decont
Geth rakudo: 25c5c488d8 | (Jan-Olof Hendig)++ | t/08-performance/99-misc.t
Add test for R#1488
22:51
rakudo: 1e2e46ff90 | (Zoffix Znet)++ (committed using GitHub Web editor) | t/08-performance/99-misc.t
Merge pull request #1499 from dogbert17/test-r1488

Add test for R#1488
rakudo/undefinitehow-default-defaults: 11e6d5e2c2 | (Zoffix Znet)++ | src/Perl6/World.nqp
Potential 6.d impl of default defaults for DefiniteHOWs

Would probably take care of github.com/rakudo/rakudo/issues/1493
  (need to be tested)
23:04
6.d-prep: a3a39741a9 | (Zoffix Znet)++ (committed using GitHub Web editor) | TODO/FEATURES.md
Add TODO: Make default defaults for DefiniteHOWs be normal types

For github.com/rakudo/rakudo/issues/1493
23:06
travis-ci Rakudo build failed. Zoffix Znet 'Merge pull request #1499 from dogbert17/test-r1488 23:47
travis-ci.org/rakudo/rakudo/builds/338747286 github.com/rakudo/rakudo/compare/e...2e46ff904b
buggable [travis build above] ☠ All failures are due to: failed make test (1 failure). Across all jobs, only t/04-nativecall/09-nativecast.t test file failed.
Geth rakudo: 7fa57657d1 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Fix fake-infix adverb args with new .= opt

Phixes: github.com/rakudo/rakudo/issues/1485
Annotate the `.=` construct so when we get to fake-infix adverbs we shove them in the right place.
23:56
roast: 4d0c09f9a2 | (Zoffix Znet)++ | S03-operators/inplace.t
Test .= calls with fake-infix adverbs

Closes github.com/rakudo/rakudo/issues/1485 Rakudo fix: github.com/rakudo/rakudo/commit/7fa57657d1