🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
Hydrazer probably like this or something 00:38
$x +< (+^$y)
well you don't really need to brackets but it's more clear 00:39
rassoc m: (<a 1>, <b 2>).flat.Hash.say # moon-child 00:41
camelia {a => 1, b => 2}
rassoc shame .flat isn't working for arrays :(
.List.flat is just as ugly as .map(&slip)
moon-child huh, why doesn't Array.flat work the same way? 01:03
rassoc who knows. another one of those raku mysteries i'm facing coming from ruby 01:22
it's even smoother there: kv.to_h # => {:a=>1, :b=>2} 01:23
Juerd It's pretty smooth in Raku if you have actual pairs to begin with, or a single list of alternating keys and values. 01:25
m: hash <a b c d>
camelia ( no output )
Juerd m: say hash <a b c d>
camelia {a => b, c => d}
Juerd m: say hash :a<b>, :c<d>
camelia {a => b, c => d}
Juerd Now, transforming a 2 element list to a pair is just unnecessarily complicated. 01:26
As is flattening something beyond the outermost list. 01:27
thundergnat m: say hash [<a b>, <c d>]».map: &flat 01:31
camelia {a => b, c => d}
rassoc still not quite sure why this has to hold, as specified in roast: 01:32
cmp-ok $x.flat, '===', $x, 'Array:U.flat is identity';
moon-child Array:U or Array:D? 01:45
wtwt5237 hi, all. I have been keeping a runtime benchmark for the raku language for every release in the past two years. In the past few months, I see a large increase in runtime for the same task performed with newly released versions 03:17
tellable6 2020-06-23T07:14:28Z #raku <MasterDuke> wtwt5237: i get fluctuating numbers on repeated runs. as low as 5.9s and as high as 7.2s. you might just have gotten a lucky 2020.02 and an unlucky 2020.0(5|6)
wtwt5237 github.com/wtwt5237/raku-for-bioin.../README.md
I want to bring this to the attention of the developers, so they may look into why 03:18
moon-child wtwt5237: if you want to get dev eyes on that, better places are probably #raku-dev and #moarvm 03:22
that said, if you are looking to make code performant, regex are probably not the way to go. You might also want to look into nqp. But (assuming MasterDuke's hypothesis is not correct) performance regressions are still worth looking into 03:25
wtwt5237 thx! 03:28
gfldex m:```use v6.*; say 3``` 10:22
m:```use v6.*; say 4``` 10:22
tbrowder m: use Modf 10:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find Modf 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/raku…
tbrowder m: use Text::Utils 10:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find Text::Utils 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/camel…
tbrowder m: use JSON::Fast
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not find JSON::Fast 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/cameli…
tbrowder m: use Test 10:25
camelia ( no output )
tbrowder g'day, all
Ven_de_Thiel o/ 10:52
lizmat And another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/06/29/2021-26-r3/ 11:11
moritz and another one hits, and another hits, another one htis the net! 11:12
rassoc lizmat: thanks! 11:14
moon-child: the Array.flat issue seems to go back a fair bit: github.com/rakudo/rakudo/pull/834#...-238749080 11:15
rassoc even zoffix thought it should be changed 11:16
nirnam ever will cached and hyper gonna play nice together? 13:20
is there a road map for that? 13:21
dakkar nirnam: how do they break? (never used them together, I'd like to know of problems beforehand) 13:22
nirnam how do they break? interestingly 13:23
dakkar can you show me an example? 13:26
perlbot nirnam pasted a new file at l.perl.bot/p/3rkd92 - 13:26
nirnam ofcourse, dakkar 13:27
dakkar oooh, I had completely mis-understood/read, I thought you were talking about the `.cache` method on Seq 13:28
nirnam the same thing can be write in perl 5 with thread and thread::shared as cache (I think, never tried)
oh, sorry I mean sub cache 13:29
dakkar yeah yeah, if `is cached` doesn't lock, that code will produce pretty weird results/errors
($work meeting, brb)
Doc_Holliwood m: say grep *.contains( none <b c d> ), <a b c d e> 13:41
camelia (a e)
Doc_Holliwood how do none junctions work?
feels like spooky action to me
moritz basically just like not(any(...)) 13:49
tonyo tbrowder: fez isn't a module creator, just a utility for making your module show up in the ecosystem 16:09
it produces as few side effects as possible
tbrowder gotcha, thnx
so the fez user needs to manually ensure the data in META6 are consistent with what zef knows about the release. is that a true statement? 16:14
tonyo yea
it makes no changes to files, no version bumps, no auth changes in the META etc
mi6 already does that stuff so i didn't see the need to reinvent (i do everything manually anyway), there is a PR on mi6 to integrate with fez 16:16
tbrowder ok, so should i remove any adverbs on the module file’s unit name line?
tonyo in what sense?
tbrowder i think mi6 puts it there, e.g.: unit module foo:auth<zef:tb>:ver<0.2.3>; 16:18
i think mi6 doesn’t care if i remove all 16:19
i’ll check mi6 some more, though. 16:20
tonyo oh, that's fine - fez makes sure the resources claimed in the meta actually exist and vice versa but doesn't parse or make sure they load or anything
tbrowder gotcha! looking good, thnx 16:21
tonyo i see modf up there, lookin good 16:29
[Coke] nirnam: if you haven't already, please open a ticket for that hyper/cached issue. (note that cached is experimental, but this definitely needs to be fixed if it's going to go mainstream) 19:31
github.com/rakudo/rakudo/blob/mast...mod#L3-L19 - there's no locking going on there. 19:34
nirnam I tried manual caching, give similar error, and switch hyper with thread same error, there's something more going here 19:35
MasterDuke manual caching with locking?
nirnam nope 19:36
[Coke] thinks docs.raku.org/type/Lock::Async might be enough? 19:38
nirnam If it break the way I think it break, just not let each hyper modipy the same caches at the same time would be enough 19:40
MasterDuke you have to have some sort of locking, modifying an array or hash isn't thread-safe. currently you'll get segfaults and such, though eventually we hope to made it higher-level errors
nirnam But I just ficking up raku from perl5 recently, I'm not sure if I can make that happen
picking*
[Coke] for now, I'd skip the cached then until we can fix this bug. 19:41
trying to add a simple lock to :cached... 19:43
MasterDuke is trying the same thing
nirnam :cached and .hyper would speed up that snippet code, especially if it that easy this would be a sole for me
alway apreciate a tool that have parallelism in the design, except js async there not much I can think off 19:45
[Coke] MasterDuke: worse here: MoarVM oops: MVM_str_hash_entry_size called with a stale hashtable pointer 19:46
er, whoops it threw out my change. 19:47
one sec. :)
ok, doesn't crash but is always returning Nil... 19:48
[Coke] MasterDuke: gist.github.com/coke/e70575dd882c0...75d6c75b03 is not quite right 19:50
MasterDuke yeah, i'm not sure why (haven't done much locking code myself) 19:51
[Coke] ... don't need the ternary if we're only locking the callsame...
MasterDuke i have almost the identical change locally
[Coke] I think the callsame might need changing. 19:53
gist.github.com/coke/e70575dd882c0...75d6c75b03 has my current version, which fails to crash, but returns Nil 19:55
I bet the callsame is confused because now it's in the protect. 19:56
oh. don't need to protect the callsame. 19:57
nirnam the thread & manual cache version does run sometimes, the other times is just blow up 19:58
[Coke] I imagine sometimes you can get lucky 20:01
perlbot nirnam pasted a new file at l.perl.bot/p/8tgl1v -
[Coke] MasterDuke: my current version dies with 999936 47 20:02
MoarVM oops: MVM_str_hash_fetch_nocheck called with a stale hashtable pointer
nirnam that doesn't seem right, starting point 47 doesn't generate that long of a chain 20:03
[Coke] updated gist. have to take a call 20:04
nirnam oh it bolloc it other way round, sorry
[Coke] Yes, it means my cache implementation is completely screwed up. :)
nirnam the out put is correct
do raku have formatter in the same vein as perl::tidy? every spaces and tabs trigger my ocd now aday 20:07
MasterDuke not really. i thought drforr had one in the works before he died that was transferred to the community modules repo, but i don't see it there 20:11
RandalSchwartz drforr died? :( 20:12
nirnam I'm sorry to hear that
MasterDuke year or two ago, scuba accident on a cruise 20:13
nirnam since raku have proper grammer and parser build in I thought that could be one already 20:14
I really hope this isn't 'only perl can parse perl' situation 20:15
MasterDuke conf.raku.org/talk/147 has some relevant info
github.com/raku-community-modules/Raku-Parser is what drforr was working on, but i'm not sure how complete it is (or if the next step of implementing a ::Tidy was started) 20:17
but as jnthn will explain in his talk, RakuAST should make such things much easier 20:18
nirnam "This year, it takes place online on August 7, 2021" 20:23
also Food freference in profile/edit 20:24
how does that work?
MasterDuke maybe they'll mail people a snack 20:26
nirnam I watched most of damian conway and bruce gray talk for perl & raku conf on youtube, this is gonna be my first live conference 20:28
MasterDuke nirnam: ok, i have it safely using `.hyper` and `is cached`, but i'm not sure how much faster it is 21:01
nirnam can I see the patch? so I can test it out
MasterDuke gist.github.com/MasterDuke17/c2769...5a5f73788e 21:03
oh, that should be Lock::Async
btw, there are some micro-optimizations you could do to your code 21:04
MasterDuke wait, maybe it shouldn't be Lock::Async 21:06
ooo, i just got a MoarVM oops. maybe the whole thing needs to be protected 21:10
nirnam rakumod supposed so be in /usr/share/perl6 right? because gentoo doesn't give me any of it 21:17
gonna have to build from git hub
MasterDuke yeah
nirnam I have .moarvm but not .rakumod, I didn't even know how this happened nor does how my rakudo even work in the first place 21:19
MasterDuke those are the pre-compiled bytecode 21:20
nirnam it is no longer crashed 21:45
nirnam annd id died 21:54
right about when it gonna be mostly cache hit 21:55
nirnam the run that does survived, hyper with :cached is about 1.16 times faster 22:04