🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
Juerd put($x) is almost twice as fast as $x.put; is that expected? 01:32
(And the whole silly benchmark oneliner is still 10x faster in Perl than Raku with the sub put...) 01:38
moon-child Juerd: I guess $x.put will have to do a method lookup. (Though I also think jnthn was working on something to make those faster?) 02:34
Juerd Ah, of course. Makes sense
moon-child aside: would be cursious to see the benchmark 02:39
Juerd time raku -e'for ^10_000_000 { put($_) }' >/dev/null 02:40
codesections with that benchmark, 99% of the difference you're seeing between Raku and Perl is the startup time (Perl's startup time rounds to 0; ours is ~100-120ms) 03:24
Juerd Something's really wrong with my raku if the startup time depends heavily on the number of iterations though ;)
codesections ha, very true it doesn't 03:25
Juerd I'm getting <2 seconds for perl, 18 seconds for raku 03:26
That 100 ms for startup isn't very relevant in that much of a difference, I'd say
codesections yeah, very true. I'm kind of surprised by that, but I was able to reproduce the issue – maybe even more so: I got 19s for $put($_) and 47 for .put 03:30
summerisle before i afk - quick picture from the raku-mode syntaxification rewrite project i'm doing: i.imgur.com/uhlRUvR.png 06:23
lizmat Juerd codesections put defers to IO::Handle.put 09:33
Mu.put is much more involved 09:34
it first needs to find out if the class of the object actually has its own "print" method, and use that
and I'm pretty sure that currently does not optimize at all 09:35
hmmm... actually, it does: wow 09:38
but the problem is really the lookup of $*OUT for each .put
that's at the top taking 1/3 of the CPU
encoding takes about 10% 09:40
lizmat BTW, you might want to try my unprint module 09:44
modules.raku.org/dist/unprint:cpan:ELIZABETH
$ time raku -e'for ^10_000_000 { put($_) }' >/dev/null
real0m20.817s
$ time raku -Munprint -e'for ^10_000_000 { put($_) }' >/dev/null
real0m5.583s
El_Che it looks like it should be the default? the 80% rule? 10:07
lizmat well, you can't make it the default, because that would break code that modifies $*OUT and friends 10:09
El_Che <insert a breake everything meme here> :) 10:12
El_Che maar de beste verbinding in .be is precies 1000/40 ofzo 10:30
lizmat El_Che: ww ? 10:35
El_Che oops 10:37
Juerd lizmat: Don't both $_.put and put($_) both need to lookup that $*OUT then? 12:36
lizmat: unprint is nice! 12:38
thundergnat m: say $*VM 12:40
camelia moar (2021.03.39.gba.124.ad.12)
thundergnat m: my ($whole, $frac) = < -1000.1 >.split('.'); say $whole.abs;
camelia Can only perform big integer operations on concrete objects
in block <unit> at <tmp> line 1
thundergnat ^^^ This only started failing recently. 12:41
bisect: old=2021.02 new=HEAD my ($whole, $frac) = < -1000.1 >.split('.'); say $whole.abs;
bisectable6 thundergnat, Bisecting by exit code (old=2021.02 new=a68d257). Old exit code: 0 12:42
thundergnat, bisect log: gist.github.com/b3b9b96e65699227dd...5402b81b44
thundergnat, (2021-04-10) github.com/rakudo/rakudo/commit/c5...5be3877e87
thundergnat lizmat ^^^ 12:43
See #R4315 12:54
safinaskar p6: s/[[:space:]]/a 13:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized regex modifier :space
at <tmp>:1
------> 3s/[[:7⏏5space:]]/a
safinaskar why this doesn't work?
p6: s/[[:space:]]/a/
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized regex modifier :space
at <tmp>:1
------> 3s/[[:7⏏5space:]]/a/
thundergnat safinaskar: For the most part the POSIX regex classes have been replaced with built-in rules. 13:28
safinaskar i have a big regex written for "grep -E" and "sed -E". how to use it in raku? that regex contains [[:space:]] 13:29
p6: s:P5/[[:space:]]/a/
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
safinaskar p6: my $a = " "; say "ok" if $a ~~ s:P5/[[:space:]]/b/ 13:32
camelia ( no output )
safinaskar as you can see there is no "ok" output even with :P5
so [[:space:]] is not supported even in :P5 mode?
thundergnat It doesn't appear so. 13:33
m: my $a = "hello world\ngoodbye world"; $a ~~ s:g/<[\h\v]>/a/; say $a
camelia helloaworldagoodbyeaworld
thundergnat You may need to convert it to use a Raku character class.
MasterDuke P5 mode isn't not 100% feature complete, and it is/was only targeting ~5.10 or something like that 13:34
safinaskar ok, thanks 13:35
patrickas Hello... when I do the following 13:42
raku -e '.say for (1..10000)' | head
I get an error Failed to write bytes to filehandle: Broken pipe
  in block <unit> at -e line 1
Unhandled exception: Failed to write bytes to filehandle: Broken pipe
   at SETTING::src/core.c/Exception.pm6:568
Is that something known? Am I doing something wrong? 13:43
$ raku -v
Welcome to Rakudo(tm) v2021.03.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2021.03.
MasterDuke pretty sure that's a known thing 13:44
github.com/rakudo/rakudo/issues/4214 and github.com/rakudo/rakudo/issues/3004 seem relevant 13:45
patrickas ok cool... Thanks
thundergnat bisect: old=2021.02 new=HEAD my $r = trim < 4 >; say $r.abs 13:48
bisectable6 thundergnat, Bisecting by output (old=2021.02 new=a68d257) because on both starting points the exit code is 0
thundergnat, bisect log: gist.github.com/84dcdd2ed8d2689b96...5ecb08198b
thundergnat, (2021-04-10) github.com/rakudo/rakudo/commit/ff...c3854308da
thundergnat Issue filed: github.com/rakudo/rakudo/issues/4316 14:01
demostanis[m] examples.perl6.org returns Connection timed out, someone should check 18:12
codesections demostanis[m]: I can reproduce the issue (specifically, I get a cloudflare error with the text: Error 522 Ray ID: 63e630938f9c03ac • 2021-04-11 18:13:35 UTC) 18:15
jdv79 leont: i'm not sure what you mean in your comment on #4278 19:08
leont jdv79: TBH, I suspect my analysis is wrong, and I should update my comment 19:09
jdv79 ok:) i was struggling to understand how using signature defaults and coercions in MAIN like that would be "wrong". 19:10
if there's a better way to "impedance match" the type system to cli args i'm all ears though 19:11
Altreus the PDF::IO::Reader class has only "open" methods, which take either a Str or an IO::Path, but I have a Buf of binary PDF data from an HTTP POST. Can I lie to PDF::IO::Reader by pretending this buf is a file? 20:05
ugexe i doubt pretending would be sufficient since its almost certainly expecting to use methods a IO::Path has 20:20
Altreus It immediately does $input-path.IO.slurp
ugexe but does it tomorrow? 20:21
you get to rely on the type signature, not the implementation details
Altreus fair enough, but can I make an IO::Path that resolves to a virtual file? :D
ugexe i dont think so 20:23
you could use augment but why not just send a PR with a new multi candidate for Bufs