🦋 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.
timotimo comma has test coverage built-in 00:27
moarvm has a coverage logger that outputs rather raw data, just filenames and line numbers
you turn it on with an environment variable 00:28
Geth doc/parameter-sub_sig: 2d99f06920 | (Stoned Elipot)++ | doc/Type/Parameter.pod6
Update Parameter.sub_signature and add example
00:52
doc: stoned++ created pull request #3736:
Update Parameter.sub_signature and add example
tbrowder i'm wondering about ways to ensure test coverage of public modules outside of the core code. 01:04
i know we have blin but that's for existing tests 01:05
Xliff What's the best way to get the columns of a multi dimensional array? 03:17
El_Che: Yeah. That's a TV. :)
Xliff Odd. 03:33
It seems to me that this is no longer lazy.
m: my @a = ^100000; my @b = ^100000; my @c = (@a x @b); say now -INIT now 03:34
camelia Can't repeat string, required number of graphemes (588889 * 100000) greater than max allowed of 4294967295
in block <unit> at <tmp> line 1
Xliff m: my @a = ^100000; my @b = ^100000; my @c = (@a X @b); say now -INIT now
camelia (timeout) 03:35
Xliff O_o
However, this is!
m: my @a = ^100000; my @b = ^100000; say (@a X @b); say now -INIT now
camelia ((0 0) (0 1) (0 2) (0 3) (0 4) (0 5) (0 6) (0 7) (0 8) (0 9) (0 10) (0 11) (0 12) (0 13) (0 14) (0 15) (0 16) (0 17) (0 18) (0 19) (0 20) (0 21) (0 22) (0 23) (0 24) (0 25) (0 26) (0 27) (0 28) (0 29) (0 30) (0 31) (0 32) (0 33) (0 34) (0 35) (0 36) (…
Xliff That turns out to be 0.6547 seconds on this end, since camelia rudely cut off my obnoxiously long output. 03:36
lizmat timotimo ^^
Xliff m: (^10000),^name.say 03:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
name used at line 1
Xliff m: (^10000).^name.say
camelia Range
Xliff m: my @a[2; 2] = (<a b>, <c d>); my @b = @a.clone 04:06
camelia ( no output )
Xliff m: my @a[2; 2] = (<a b>, <c d>); my @b = @a.clone; @b.gist.say 04:07
camelia [a b c d]
Xliff m: my ($r, $c) = 2 xx 2; my @a[$r; $c] = (<a b>, <c d>); my @b = @a.clone 04:10
camelia ( no output )
Geth doc: cbbdb3b759 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Parameter.pod6
Update Parameter.sub_signature and add example
06:29
linkable6 Link: docs.raku.org/type/Parameter
Geth doc: 67358682f7 | (Stoned Elipot)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Parameter.pod6
Update Parameter.name and add example, ref #3580
linkable6 DOC#3580 [open]: github.com/Raku/doc/issues/3580 [checklist][docs] Checklist for 2020.08
coldpress anyone knows how to solve today's (Day 15's) Advent of Code part 2 in less than 1.6 hours? 06:56
moritz where is part 2? 07:55
coldpress moritz: it's the same as part 1, but instead of finding the 2020th number, you find the 30000000th number 08:10
i'm now thinking of having an array for the lower-valued numbers, and a hashmapfor the higher-valued numbers
moritz can't you just have a hash that is indexed by number and the value is the last occurance index? 08:12
or is that too slow?
coldpress that takes 1.6++hours 08:44
numbers said are distributed logarithmically, so lower numbers are said very often 08:45
hashing an integer 30000000 times is not ideal
alright, can confirm that using an array for the lower 300 numbers gives a user time of 24min and sys time of 18min 08:51
timotimo huh that is a really big amount of sys time. it doesn't do a lot of swapping or anything, does it? 08:52
MasterDuke m: my %h; %h{$_}++ for ^1_000_000; say now - INIT now; say %h.elems;
camelia 3.4712895
1000000
08:53
MasterDuke m: my Int %h; %h{$_}++ for ^1_000_000; say now - INIT now; say %h.elems;
camelia 3.4336643
1000000
MasterDuke huh. locally i get a consistent difference of 0.4s slower for the Int hash 08:54
coldpress m: my Int %h; %h{$_}++ for ^30_000_000; say now - INIT now; say %h.elems; 08:56
camelia (timeout)
coldpress I think big hashmaps take more time
because not enough buckets or something like that 08:57
well I guess not all 30_000_000 numbers are actually hashed
should be more like 10_000_000 08:58
m: my Int %h; %h{$_}++ for ^10_000_000; say now - INIT now; say %h.elems;
camelia (timeout)
MasterDuke spends almost all the cpu time in MVMHash_gc_mark 09:03
non-linear. locally. 1m entries takes 2.5s, but 10m took 83s 09:04
timotimo m: my Int %h{Int}; %h{$_}++ for ^10_000_000; say now - INIT now; say %h.elems 09:41
camelia (timeout) 09:42
MasterDuke for 10m it's 5s quicker when it's not typed. i.e., 83s for Int, 78s for normal 09:44
timotimo ah, dang. possibly because stringifying an Int is slightly less work than putting the class name in front 09:45
m: say 1234.Str; say 1234.WHICH
camelia 1234
Int|1234
tbrowder jmerelo: i keep getting a "ping back" on my advent article via email, click on the link, and get a piece of someone's blog but no comments that i can see. i would love to address the reply but can't see it. any ideas? 11:14
jmerelo tbrowder: other than marking it as spam, none. Thing is, it looks legit... 11:58
tbrowder thnx 11:59
jmerelo tbrowder: no problem :-)
lizmat clickbaits rakudoweekly.blog/2020/12/14/2020-...wikipedia/ 12:39
m6locks clicks 12:59
leont wrote a thing dev.to/leontimmermans/better-argum...-long-2o13 14:45
tadzik huh, TIL about enums blowing up the parser 14:47
well, dispatcher
leont++ 14:48
leont Yeah, it's decidedly unhelpful behavior if you ask me 14:52
leont We really ought to have an option to disable it 14:58
tony-o interesting article leont 15:49
rir In a parent class: self.^name.^attributes[0].get_value indirectly shows I have a BOOTSTRAPATTR. How do I get to the real Attributes in this situation. This is similar V V. 17:02
p6: (class E { has $.i = 1}).new().^name.^attributes[0].name;
camelia ( no output )
rir ^^ on my 6.c, I get: $!value 17:04
MasterDuke p6: say (class E { has $.i = 1}).new().^name.^attributes[0].name; 17:06
camelia $!value
rir MasterDuke, I was thinking (or maybe not) that I was in a REPR here. 17:08
MasterDuke not sure i follow 17:09
rir I am trying to manipulate self's Attributes array in a parent class ( a role might work) and am stuck on how to get beyond the BOOTSTRAPATTR precursor type. 17:12
dakkar I'm not sure what that ^name is doing 17:14
dakkar it returns a *string* 17:14
why are you looking at the attributes of a string?
m: (class E { has $.i=1 }).^attributes[0].name 17:15
camelia ( no output )
dakkar m: say (class E { has $.i=1 }).^attributes[0].name
camelia $!i
dakkar rir: ^
rir Thanks, dakkar, that shows me my error. Now to find the correction! 17:19
dakkar m: sub list_attrs($c) { $c.^attributes.map: -> $a { say "{$a.name} {$a.?readonly // False ?? 'ro' !! 'rw' } {$a.?container.^name }" } }; list_attrs(Str); list_attrs({}); list_attrs(->{}) 17:24
camelia $!value rw Nil
$!descriptor ro ContainerDescriptor::Untyped
$!storage ro BOOTHash
$!phasers rw Nil
$!why ro Nil
$!do ro Code
$!signature ro Signature
@!compstuff ro Nil
dakkar (slightly annoying that the MOP is not really consistent, due to the bootstrap bits) 17:25
cfa o/ 17:47
m: say 'foo' ~~ /foo/ 17:49
camelia 「foo」
cfa m: ('foo' ~~ /foo/) ~~ 'foo'
camelia ( no output )
cfa m: say ('foo' ~~ /foo/) ~~ 'foo'
camelia True
cfa m: say ('foo' ~~ /foo/) == 'foo' # LTA
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)
in block <unit> at <tmp> line 1
moon-child use eq for str compare 17:55
m: print ('foo' ~~ /foo/) eq 'foo'
camelia True
cfa hmm, yeah; i suppose 'foo' == 'foo' yields the same base conversion error 17:57
this is just a golfed typo (== instead of ~~), error struck me as lta 17:59
but to your point, i guess it's just a less golfed use of == instead of eq 18:00
moon-child yeah, we could probably get a nicer error msg for when numeric relational operators are used for uncool strings
cfa agreed 18:01
melezhik .tell jmerelo, do we have free spots left in raku advent calendar? I have another post in mind for that 18:14
tellable6 melezhik, I'll pass your message to jmerelo 18:15
jmerelo melezhik: not totally sure, but in principle we're covered, thanks :-) 18:53
tellable6 2020-12-15T18:14:59Z #raku <melezhik> jmerelo, do we have free spots left in raku advent calendar? I have another post in mind for that
melezhik .tell jmerelo , then, disregard my last post, I will probably put it as regular one ... no worries 18:58
tellable6 melezhik, I'll pass your message to jmerelo
melezhik I just posted , might be interesting for people who want to use Raku for devops - www.reddit.com/r/rakulang/comments...s_cluster/ 19:02
notable6: Sparky on k8s cluster - sparrowdo.wordpress.com/2020/12/15...s-cluster/ 19:04
notable6 melezhik, Noted! (weekly)
[Coke] nandgame.com/ - off topic, but fun logic puzzle site. 19:20
(in circuitry form.) 19:21
Doc_Holliwood heyo somebody in the mood for finding my schlemiehl? 19:30
i wrote this for todays advent puzzle: pastebin.com/sKEwmgFd
Doc_Holliwood every million iterations takes one second longer than the previous one and i just don't see why 19:31
it also keeps using more and more memory, looks like a leak 19:32
[Coke] your hash is increasing in size, no? 19:54
Doc_Holliwood yes but that is negligble 20:03
it's in the 100s, element wise
Xliff \o 20:26
Will $id be available in the else block if I do something like this: if expr() -> $id { ... } else { ... }
If not, what's the idiomatic way to do that? 20:27
[Coke] m: if 33 -> $id { say $id } else { say 'nope' } 20:37
camelia 33
[Coke] Doc_Holliwood: no specific comments on your solution there, but thank you for reminding me about AOC. 20:44
Doc_Holliwood Coke: array of? 20:46
[Coke] advent of code 20:49
Doc_Holliwood ah yes. lol 20:57
Geth doc: 28fc996651 | Coke++ | util/update-and-test
Don't check our dependencies if we don't have to
22:31
doc: 2da1c25483 | Coke++ | doc/Type/Array.pod6
Need empty parens for no arg sig
linkable6 Link: docs.raku.org/type/Array
ggoebel Doc_Holliwood: here's my Day 15 for AoC pastebin.com/zrCC4DTD 22:36
my laptop has an i5-5300U CPU @ 2.30GHz. my script takes around 24.5 minutes 22:38
I see a similar slow down, but on the order of 2-3 seconds per 1,000,000
I'm running your script now... looks to have similar performance 22:41
ggoebel your script ran in 17.5 minutes 22:57
Doc_Holliwood this should run in 16ish minutes then 23:04
twitter.com/HrBollermann/status/13...2650756096
i eliminated the condition