🦋 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.
jdv79 how does one match a \r that's next to a \n? 00:07
m: "a\rb".subst(/\r/, "_") 00:08
camelia ( no output )
jdv79 m: "a\rb".subst(/\r/, "_").say
camelia a_b
jdv79 m: "a\r\nb".subst(/\r/, "_").say
camelia
jdv79 wut
timotimo jdv79: raku doesn't match partial graphemes 00:24
jdv79 then how do i do that? i actually need to basically do "\r" => "something else" 00:25
too many llys
timotimo you'll need to match \r\n separately from \r 00:27
jdv79 i guess for now i'll loop over .codes and stitch it up verbosely 00:28
i thought you implied that's not possible at the moment
oh, i see. i can't do that. 00:29
thanks anyway
oh, i can. nevermind. ok. 00:32
timotimo right, it's one character, but it's a distinct one you can match 00:34
i mean, characters that have it can be matched against
there's only one that fuses with it afaik
cpan-raku New module released to CPAN! Test::Async (0.0.13) by 03VRURG 02:05
patrickb .tell melezhik Reasons for Azure: Supports MacOS, Windows, Linux. Has no usage limits. 06:00
tellable6 patrickb, I'll pass your message to melezhik
tyil .tell melezhik I dont work on Rakudo, I only do the Star bundle, I wouldn't touch Azure, and I try to stay away from GitHub when I can too 07:01
tellable6 tyil, I'll pass your message to melezhik
sour Hi, has anyone tried to install zef packages and got "Enabled fetching backends [pswebrequest path curl wget] don't understand www.cpan.org/authors/id/J/JS/JSTOWE....tar.gzYou may need to configure one of the following backends, or install its underlying software - [git]" as a result? I'm unsure what this means, I got 07:25
git installed D:
Also, what logging package do you guys use? I tried to go for Lumberjack, but it seems that tests are failing when trying to install it...
Also, that message is from zef install Lumberjack - a subsequent rerun of the same command passed through that part 07:26
sarna o/ 07:34
El_Che patrickb45: don't they all support the 3 OSes nowaday? 07:39
MasterDuke El_Che: i don't so at the free tiers 07:44
patrickb45 El_Che: Partly. E.g. Travis has minimal / beta support for Windows. 07:49
CircleCI supports all three, but has a bug in their billing which makes it impossible for OSS projects to build on Windows. 07:50
AppVeyor only supports one build job at a time in their free tier. 07:53
sarna m: ((my $foo, my @bar), my @baz) = [[1,2,3],4,5]; say "foo: $foo, bar: {@bar}, baz: {@baz}" # why doesn't this dwim? 07:59
camelia foo: 1 2 3, bar: 4, baz: 5
sarna (I'd like `$foo` to be 1, `@bar` to be [2,3] and `@baz` to be [4,5])
sarna www.evanmiller.org/a-review-of-perl-6.html mentions destructuring assignment and says what to do so the left hand side doesn't get flattened - but it doesn't seem to work anymore? 08:09
I can't find the colon version in the docs either
dakkar I'm looking at it 08:10
m: sub x(($a,*@b),*@c) { say $a;say @b;say @c }; x((1,2,3),4,5) 08:11
camelia 1
[2 3]
[4 5]
dakkar so it works in the way the documentation says, with a signature docs.raku.org/type/Signature#Destr..._arguments
sarna yeah but I want to do this *inside* a sub 08:12
..or should I create a sub and invoke it just to get destructuring
dakkar I don't think destructuring *assignment* handles slurpies (which you need, notice the `*` in that signature) 08:14
but you should be able to use a signature without a sub
sarna yeah, but why doesn't the old colon version work? did it get dropped? 08:15
dakkar I don't know what you mean my "colon version", sorry. Can you give me an example?
sarna now the compiler says "Lexical with name '$foo' does not exist in this frame"
www.evanmiller.org/a-review-of-perl-6.html, ctrl+f "destructuring assignment"
dakkar (I'm not an expert, I'm just good at pretending)
sarna aren't we all 08:16
dakkar ok, that example is binding (`:=`) to a signature literal (`:(...)`)
which is exactly what I was trying to do ☺
give me a minute
sarna hmm..
dakkar ok, that looks wrong 08:17
m: my ($a,@b,@c); :(($a,*@b),*@c) := ((1,2,3),4,5);
camelia ( no output )
dakkar m: my ($a,@b,@c); :(($a,*@b),*@c) := ((1,2,3),4,5); say $a; say @b; say @c;
camelia 1
[2 3]
[4 5]
dakkar well, looks like it was broken then fixed! get the latest rakudo 08:18
sarna gasps
dakkar (I get the same error you do, on 2020.02)
m: my :(($a,*@b),*@c) := ((1,2,3),4,5); say $a; say @b; say @c;
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed my
at <tmp>:1
------> 3my7⏏5 :(($a,*@b),*@c) := ((1,2,3),4,5); say $
sarna no, your newest version works for me too :)
oh well I have 2020.05.1 anyway so 08:19
dakkar notice that you need to declare the names before you bind to the signature that mentions them
sarna thank you so much :)))
dakkar oh, so maybe my problem is in how I was using the REPL
sarna oh let me try something actually
dakkar glad to be of service
sarna yeahh if you say the first line, hit return, and try to enter the rest - it doesn't work 08:20
it has to be on one line
I hope just in the repl, not in a text file..
dakkar or in a proper program ☺
sarna that's cool with me then! 08:21
lizmat clickbaits rakudoweekly.blog/2020/05/18/2020-...-upgraded/ 09:05
sjn clickbaits rakudoweekly.blog/2020/05/18/2020-...-upgraded/ 09:28
"You'll never believe what happens next!" 09:29
lizmat :-)
El_Che hi sjn ! 09:37
(and everyone else as well, but sjn has been a while :) )
mental image can not be unseen
sjn hei, El_Che, it's been a while! :-) 09:43
moritz Hi sjn! Since we couldn't Norway for 17. May, we made our own little celebration here in .de 10:32
20200510_104025.jpg 10:35
eeks
imgur.com/a/LK3s1Ov proper link now :D
tadzik mmm :) 10:43
sarna what a lovely pie 10:47
MasterDuke those look good 11:16
sjn moritz: that was nice! Hope you had a nice celebration! :-) 11:36
moritz sjn: we had :D
thanks all 11:37
[Coke] lizmat: regarding the stack overflow article about unicode... you *can* search for « in the site search. 13:10
lizmat op mentioned Google search, no ?
but maybe a good idea to mention in the answer 13:11
[Coke]++ 13:13
[Coke] lizmat++ (updating the answer) 13:15
sarna what's the name of the polymorphic equality operator? 13:19
timotimo you mean eqv?
sarna yess, thank you
timotimo :) 13:20
[Coke] m: say &infix::eqv eqv &infix::eqv 13:22
camelia True
[Coke] m: say &infix::eqv infix::eqv &infix::eqv 13:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say &infix::eqv7⏏5 infix::eqv &infix::eqv
expecting any of:
infix
infix stopper
postfix
statement end
sour wow, function comparison 13:24
timotimo [Coke]: one : too many 13:29
m: say &infix::eqv
camelia (Any)
timotimo m: say &infix
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
infix used at line 1. Did you mean 'index', 'indir'?
timotimo m: say &infix::
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
infix used at line 1. Did you mean 'index', 'indir'?
timotimo m: say infix::
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
infix used at line 1. Did you mean 'indir', 'index'?
timotimo *shrug*
jdv79 i got the latest moarperf release, fired it up, but all i get is 404s 14:14
timotimo hum, did i push that last change improperly? 14:17
MasterDuke i still have to redirect manually sometimes 14:18
jdv79 it looks partial 14:19
at least the static subdir is missing
i tried copying in the node_modules from the release over a git checkout and it gets farther but no dice
timotimo dang, let me have a look at the travis file 14:20
jdv79 maybe i'll try the n-1 release
timotimo here's the "how did this ever work" moment i guess 14:21
jdv79 n-1 release doesn't work either. maybe its me. 14:23
i download and extract the release and run raku -I. service.p6 foo.sql and go to localhost:20000 - is there more/is that wrong?
timotimo github.com/timo/moarperf/releases/...1856407e17 - give this a try please 14:24
wait what, why are there symlinks 14:25
jdv79 that one got farther 14:28
now a 500
timotimo -rw-rw-r-- travis/travis 148137 2020-05-19 16:23 static/js/allocationviewer.js
timotimo hrw-rw-r-- travis/travis 0 2020-05-19 16:23 static/js/allocationviewer.js link to static/js/allocationviewer.js 14:28
jdv79 DBDish::SQLite: Error: no such table: pragma_table_info (1)
and the browser actually has content - header stuff and "hold on..." 14:29
timotimo um that's a sqlite builtin
jdv79 weird
timotimo sqlite.org/pragma.html#pragma_table_info 14:30
timotimo it's just used to see if the version of the sqlite data is old and it needs to generate some extra data for convenience 14:30
jdv79 darn. got a meeting. i'll dig in after i guess.
thanks
jdv79 seems that table is part of "experimental" stuff and it might not be avail in my ver - 3.11.0:( 14:43
or it was? 14:46
timotimo wtf :( :( :( 16:07
well, you can probably comment out the code that does it 16:08
jdv79 no biggee. docker:) 16:09
i should upgrade my $work box anyway - just one more reason
timotimo 2016-02-15 (3.11.0) 16:10
it's long ago but not *that* long ago
timotimo huh, but it already existed long before 16:11
jdv79 wow. the gc ran for 2.2s out of the 8.3s run time. 16:27
is that normal?
timotimo that's quite the amount 16:30
in the gc slot in the graphs you'd see how many objects are being kept alive each time 16:31
the more the gc can toss out in minor runs, the better gc performance in general will be
but of course that all depends on what kind of data you're working with in the first place
jdv79 its almost all "freed very early" 16:35
is that what you mean?
timotimo that should be very good 16:36
what are the individual gc run times? how many times does it run a major ("full") rather than minor collection?
jdv79 the times seem to grow fairly evenly - from 5ms to 30ms 16:38
127 runs
where do i see major vs minor? 16:39
timotimo majors will have a little star, and you can filter major vs minor vs all at the top, and the overview page has it in prose as well
jdv79 i think there were no majors 16:41
both pages seem to agree on that
timotimo OK
jdv79 weird
timotimo hm. things that can make gc runs take longer even if many things are freed are for example very deep recursion or objects with many many references like a million elements list of Int objects 16:42
does it show the amount of references when you expand gc runs? 16:43
jdv79 idk about millions. this is just taking 20 json files and munging them into an xml output
its not that complicated, i don't think
where would i see this "references"? 16:44
timotimo if it exists, clicking a row in the gc table on the gc tab would be the place 16:46
jdv79 are you talking about the counts in the "freed *" columns? 16:47
timotimo hm, no, that'd be objects rather than references
jdv79 i don't know what you are referring to then 16:48
timotimo good pun 16:49
probably a thing the profiler doesn't record ... yet!
trying to get an example program to profile m(
jdv79 anyway. idk how to address that so i guess i'll ignore it.
but 25% is not insignificant - i'd like to get that down if possible 16:50
timotimo for sure
the heap snapshot profile mode would do a better job of telling you what's up 16:51
jdv79 no real surprises otherwise. looks generally dominated by "regexy stuff" 17:59
jdv79 JSON::Fast is the biggest:( 18:01
timotimo JSON::Fast uses no regexes :| 18:03
but that's for run time?
jdv79 oh right - that was json tiny 18:08
yeah. from-json is one of my top. 18:09
timotimo ah, would be interested to see how json::fast compares for your use case 18:10
jdv79 and subst() is in there but seems like 40% of it 18:10
JSON::Fast::from-json() is about 50% of my runtime 18:12
gonna try JsonC
jdv79 huh. its ~2x slower 18:24
ok then
jdv79 too much raku in that "c" module" i guess;) 18:28
is there a faster way to parse json?
timotimo yeah, there's a library that parses json with vectorized ops. no raku binding for it yet 18:54
branchfree.org/2019/02/25/paper-pa...er-second/ 18:55
if you'd like to, you could anonymize the json file(s) and chuck them my way so i can profile them thoroughly perhaps %) 18:56
jdv79 wow, the pre-comp diff is real. moved my MAIN into a module and went from 2.7s to 0.7s "no-op" runtime 18:58
Doc_Holliwood why the heck is Inf a Num? i mean, OBVIOUSLY Inf is an Int 18:59
jdv79 i can probably gen something someday - its customer data though so it'd be non-trivial
i'll make a note
poohman m: use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find Text::CSV in:
inst#/home/camelia/.raku
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/camelia…
poohman hello all, cant use modules here? 19:27
MasterDuke not with camelia. there is a way to do it with the *ables though 19:28
poohman having some problems with the Text::CSV module - not getting an array of hashes as mentioned in the documentation 19:29
MasterDuke e: use lib ‘data/all-modules/cpan/TIMOTIMO/JSON-Fast’; use JSON::Fast; 19:30
poohman instead getting array of array when headers => "uc" or "lc" or callable
evalable6
poohman e: use lib 'data/all-modules/cpan/Tux/CSV';use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:33
evalable6 (exit code 1) 04===SORRY!04=== Er…
poohman, Full output: gist.github.com/1cf66d0e2192b07ec4...0a6c71826b
poohman e: use lib ‘data/all-modules/cpan/Tux/CSV’;use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:34
evalable6 (exit code 1) 04===SORRY!04=== Er…
poohman, Full output: gist.github.com/686913dd32d1a4bc93...3a58ed80ad
poohman e: use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:38
evalable6 (exit code 1) 04===SORRY!04=== Er…
poohman, Full output: gist.github.com/16ab3442c414d90711...462e85f084
poohman need to hit the sack - its late here - tomorrow is another day - bye 19:42
sour goodnight 19:43
MasterDuke e: use lib ‘data/all-modules/github/Tux/CSV’;use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:47
evalable6 (exit code 1) 04===SORRY!04=== Er…
MasterDuke, Full output: gist.github.com/0e7f176f20b7e0fe29...dfb80c64e6
MasterDuke e: use lib ‘data/all-modules/github/Tux/CSV’; use lib ‘data/perl6-all-modules/github/FROGGS/p6-Slang-Tuxic’; use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:48
evalable6 (exit code 1) 04===SORRY!04=== Er…
MasterDuke, Full output: gist.github.com/48c5609ced79982db8...726d75332b
MasterDuke e: use lib ‘data/all-modules/github/Tux/CSV’; use lib ‘data/all-modules/github/FROGGS/p6-Slang-Tuxic’; use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:49
evalable6 (exit code 1) 04===SORRY!04=== Er…
MasterDuke, Full output: gist.github.com/5e96660867ab6c82cd...8b01351d6a
timotimo you know, evalable bots could totally have a custom CUR that lets you write just the name of the module and it gets the right path for you 19:50
MasterDuke e: use lib ‘data/all-modules/github/Tux/CSV’; use lib ‘data/all-modules/github/FROGGS/p6-Slang-Tuxic’; use lib ‘data/all-modules/github/perlpilot/p6-File-Temp’; use Text::CSV; my @aoh = csv(in => ["header1,header2\n1,2\n3,4\n"], sep =>",", headers => "uc");say @aoh.keys; 19:51
evalable6 (exit code 1) 04===SORRY!04=== Er…
MasterDuke, Full output: gist.github.com/0cd2111f472b74d03a...596ab687c3
MasterDuke yeah, that would be nice
sour has anyone used Cro::HTTP::Client together with Cro::WebSocket::Client? I'm able to reproduce some really strange bug: when I declare a class member as a websocket, the internal Uri parser is unable to parse URIs 20:14
lizmat sour: maybe #cro is a better channel to ask this on :-) 20:15
sour oh, I wasn't aware there was a special channel, thanks!
lizmat yes, there is! 20:17
Guest71053 welp, "/quit" is not what you use to leave a single channel 20:18
El_Che as the cros fly 20:18
->/leave
[Coke] uses "/win c" 20:41
timotimo i normally use /wc i think 20:42
i literally brainfarted that
El_Che timotimo: I have exact that alias
lucs What does \('foo') mean? 20:43
lizmat m: dd \("foo").^name 20:44
camelia "Capture"
El_Che Capture
lucs Ah, thanks.
lizmat it is a Capture of a single positiional argument
El_Che m: dd \("foo").WHAT
camelia ( no output )
El_Che m: say \("foo").WHAT
camelia ( no output )
El_Che mm 20:45
the says (Capture) in the REPL
lizmat that *is* strange
timotimo i get "(Capture)" with -e, too 20:59
lizmat m: say "hello" 21:00
camelia hello
chloekek I wonder how capable PCRE is regarding Raku regexes, ignoring syntax. 21:02
Would be cool if we could just write a Raku regex parser, translate to PCRE regex, and plug it into PCRE and it works. 21:03
chloekek Perhaps if prefixed with (?6) it could do that automatically. 21:03
Things like % and %% and | (but not ||) would probably be translated in a very ugly way. 21:07
Not to mention &&.
Doc_Holliwood how do i pass a type to a function so that function can use it to instantiate a parametrized role? basically I have role R[::T] { sub helper( $type ) { R[$type].new } } but that doesnt work 21:23
dies with Died with X::Multi::NoMatch
timotimo how are you calling it? 21:25
Doc_Holliwood nevermind, i had an error in my actual signature 21:27
melezhik rba AlexDaniel` I've spinned up a rakudist worker in i-088204c3758429047. It's t3a.small one, 2 GB / 2 Core. web UI itself is on my laptop so fat 21:40
tellable6 2020-05-19T06:00:39Z #raku <patrickb> melezhik Reasons for Azure: Supports MacOS, Windows, Linux. Has no usage limits.
2020-05-19T07:01:55Z #raku <tyil> melezhik I dont work on Rakudo, I only do the Star bundle, I wouldn't touch Azure, and I try to stay away from GitHub when I can too
melezhik so far 21:41
@ty
tyil[m] makes a sense , I see
melezhik rba AlexDaniel` when we test aws worker we can move master part (rakudist web UI + sparky ) to the VM with blin 21:43
so we might have a setup with master on VM and as many workers as we want on aws 21:44
melezhik but I get things slowly, one by one , to see how it goes and not to over budget :-))) 21:44
tuxlovesyou waves in penguin 22:04
raku-bridge <tuxlovesyou> /me also waves in penguin 22:05
timotimo my weechat cuts off the nickname of raku-bridge to read "raku-brid" and i kind of want it to be renamed "raku-bird" now 22:10
guifa o/ 22:35
lucs docs.raku.org/language/grammars#Cr...g_grammars mentions "If action objects are not used, .parse returns a Match object and sets, by default, the default match object $/, to the same value." 23:02
What's the difference if an action object is used?
guifa Actually just returns the match object, plus anything special in the .made 23:11
lucs Yeah, I guess the phrasing just needs a bit of improvement.
guifa We should probably clear that up in the docs.
jinx
haha
lucs :)
lucs How does this sound?: "If actions or action objects are not used, you can still examine the Match object returned by .parse, which also happened by default to set $/, the default Match object." 23:18
lucs Oops, s/."$/, to the same value."/ 23:24
guifa I would proabbly just delete the "If action objects are not used, .parse returns a Match object and sets, by default, the default match object $/, to the same value." lien entirely. 23:34
lucs Hmm... It's true that this is the first time .parse is mentioned in the document. 23:37
The more I read the document, the more, um, difficulties I find with it :/
For example, action objects are discussed, but I don't see anything about actions within the grammar. 23:41
Documentation is hard :/ 23:51
In the grammars tutorial: "Token methods are faster than regex methods and ignore whitespace."
"ignore whitespace" What does that mean? 23:52
(not looking for an explanation, just pointing out the difficulty) 23:55
lucs should open issue tickets instead of complaining, eh. 23:57
guifa Grammars are particularly tough, because you want the docs to be quick reference, but grammars need more of an entire tutorial / larger example 23:58