🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
Set by lizmat on 8 June 2022.
[Coke] why is it .add_phaser? 00:57
should it be changed to add-phaser at some point?
01:01 Voldenet left 01:06 Voldenet joined 05:02 vrurg_ joined 05:03 vrurg left 05:24 vrurg_ left 05:25 vrurg joined 08:19 sena_kun joined 08:34 sena_kun left 08:43 finanalyst joined 09:01 kjp_ joined, RakuIRCLogger left, kjp left
lizmat [Coke]: that touches on a more general thing: in the Raku grammar I have tried to use kebab-case where possible. However, some of it goes back to NQP 09:32
and thus back to snake_case
also add_phaser is not tested anywhere, and could thus be considered to be an implementation-detail 09:34
so I've run into something that's really puzzling, at least to me: 10:44
m: use Telemetry; say (^Inf).grep(*.is-prime).skip(999999).head; say T<cpu-user>/1000000
camelia 15485863
5.405457
lizmat iow, give me the millionth prime number 10:45
in the single threaded case, this takes 5.4 CPU seconds
if we hyper that:
m: use Telemetry; say (^Inf).hyper.grep(*.is-prime).skip(999999).head; say T<cpu-user>/1000000 10:46
camelia 15485863
21.335601
lizmat it takes quite a few CPU seconds more 10:47
however, if we set a bigger batch size (larger than the 64 by default):
m: use Telemetry; say (^Inf).hyper(batch => 1024).grep(*.is-prime).skip(999999).head; say T<cpu-user>/1000000
camelia 15485863
3.584926
lizmat it takes a lot less CPU!
but the weird thing (to me at least) is that it takes *less* CPU than the single threaded case! 10:48
m: say 3.584926 / 5.405457 10:49
camelia 0.66320498
lizmat on my M1 the difference is even more pronounced 0.52 10:50
so what causes this difference? 10:55
m: use Telemetry; use nqp; my $i = -1; nqp::while(++$i < 15485863, nqp::isprime_I(nqp::unbox_i($i))); say T<cpu-user>/1000000 11:07
camelia 1.960859
lizmat so that would be the NQP minimum CPU usage
Geth rakudo/main: 097b50cd0d | (Elizabeth Mattijsen)++ | t/12-rakuast/fixed-in-rakuast.rakutest
Properly mark failing test as todo

Apparently "make test" files are not fudged
11:34
12:50 lizmat left 13:04 lizmat joined
Geth rakudo/main: 2e4bc48a1b | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.rakumod
Micro-optimize basic iterators

  .push-all / sink-all specifically, by creating lexical shortcuts to
static attributes, so that these can be lowered into locals in the hot code paths.
Makes:
   for ^10000 { (^1000).map(* + 1).iterator.push-all(IterationBuffer.CREATE) }
about 1.5% faster
13:13
lizmat looks like the problem is in grep: 13:47
m: use Telemetry; say (^Inf).map({ $_ if .is-prime}).skip(999999).head; say T<cpu-user>/1000000 13:48
camelia 15485863
2.240862
lizmat m: use Telemetry; say (^Inf).grep(*.is-prime).skip(999999).head; say T<cpu-user>/1000000
camelia 15485863
5.768551
lizmat consequently with the proper hyper: 13:49
m: use Telemetry; say (^Inf).hyper(batch => 2048).map({ $_ if .is-prime}).skip(999999).head; say T<cpu-user>/1000000 13:50
camelia 15485863
3.76585
Geth rakudo/main: 72b46fe292 | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.rakumod
Some more lexical shortcuts

These were missed in 2e4bc48a1b
14:04
lizmat refrains from being drawn into the grep vortex for now
[Coke] (add_phaser not tested) so not spec, so not part of docs. Excellent :) 14:10
lizmat greppable6: add_phaser
greppable6 lizmat, 11 lines, 5 modules: gist.github.com/1eec5b78ac2819b892...943af07936
lizmat mostly the usual suspects :-) 14:12
[Coke] ... weird, I no longer see the add_phaser ticket. :| 14:15
14:27 vrurg_ joined, vrurg left 15:31 nine left, nine joined 17:25 sena_kun joined
Geth rakudo/main: 6846c49ed1 | (Elizabeth Mattijsen)++ | src/core.c/Any-iterable-methods.rakumod
Adding some more lexical shortcuts

In the grep hierarchy of push-alls
18:36
rakudo/r1378: 16981ad9ba | ab5tract++ | 2 files
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (10 more lines)
19:14
nqp/r1378: 25362cf803 | ab5tract++ | src/HLL/Grammar.nqp
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (9 more lines)
19:20
nqp/r1378: 3e1c47538a | ab5tract++ | src/HLL/Grammar.nqp
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (9 more lines)
19:25
nqp/r1378: 8dba195cb8 | ab5tract++ | src/HLL/Grammar.nqp
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (9 more lines)
19:26
[Coke] ab5tract: "nowehere"
Geth rakudo/r1378: 3c5988198a | ab5tract++ | 2 files
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (10 more lines)
19:28
ab5tract [Coke]: thanks!
[Coke] ab5tract++ 19:31
Geth nqp/main: fa489fe301 | ab5tract++ (committed using GitHub Web editor) | src/HLL/Grammar.nqp
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (9 more lines)
19:50
rakudo/main: 3ce05fa0db | ab5tract++ (committed using GitHub Web editor) | 2 files
Provide better feedback for ambiguous adverb usage

This fixes an LTA situation:
   > my %h = :1k; say 1 ~ %h<k>:exists ~ 1
   ===SORRY!===
   MVMArray: Can't pop from an empty array
... (10 more lines)
19:51
rakudo/main: 3a928a5616 | ab5tract++ | t/12-rakuast/fixed-in-rakuast.rakutest
Test for ambiguous adverb exception

This is only properly testable in RakuAST, as base dies in NQP's HLL::Grammar without an exception class to verify against (#1378).
We could test against the text of the die message, but my experience has led me to consider that bad practice and the situation in base is only temporary anyway.
20:15
21:24 finanalyst left
Geth rakudo/main: a26b756a50 | ab5tract++ | t/12-rakuast/fixed-in-rakuast.rakutest
Tests indices for shaped arrays automatically coerced to Int

This is to keep R#1297 (#1297) from regressing in RakuAST.
21:43
linkable6 R#1297 [open]: github.com/rakudo/rakudo/issues/1297 [shaped][Fixed in RakuAST] Indices for shaped arrays need manually coerced to numbers
Geth rakudo: ab5tract++ created pull request #5576:
Give META_REDUCE_RIGHT behavior for 1-arg case
21:59
22:00 sena_kun left
leont I haven't looked into it yet, but I'm guessing this Perl issue is also relevant for Raku quoting constructs github.com/Perl/perl5/issues/22228 22:55
[Coke] leont++ 22:58
ab5tract not just Perl. macOS won't even successfully highlight the `$weird` example 23:06