🦋 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.
[Coke] MasterDuke++ 00:03
Xliff m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B does AA { }; C.new.a 00:46
camelia role A
Xliff m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA }; C.new.a 00:48
camelia role A
moon-child m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C does AA is B { }; C.new.a
camelia role A
Xliff I don't want the role to override A.a 00:49
But I do want A.a to refer to AA.a
m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA }; B.new.a; C.new.a 00:50
camelia class a
role A
Xliff Let's say that C.new.a is running A.a -- how would I refer to AA.a via self? 00:53
m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA method a { 'class C'; }; }; B.new.a; C.new.a
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3le A'; }; }; class C is B { also does AA7⏏5 method a { 'class C'; }; }; B.new.a; C.
expecting any of:
infix
infix stopper
Xliff m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA; method a { 'class C'; }; }; B.new.a; C.new.a
camelia class a
Xliff m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA; method a { sau 'class C'; }; }; B.new.a; C.new.a 00:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
sau used at line 1. Did you mean 'say'?
Xliff m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA; method a { say 'class C'; }; }; B.new.a; C.new.a
camelia class a
class C
Xliff Aha!
Answering my own question... 00:56
m: class A { method a { say 'class a' }; }; class B is A { }; role AA { method a { say 'role A'; }; }; class C is B { also does AA; method a { say 'class C'; self.AA::a }; }; B.new.a; C.new.a # Et voila!
camelia class a
class C
role A
patrickb o/ 06:57
Anyone knows who is responsible for the raku mailing lists?
lizmat patrickb: which one do you mean? 07:58
patrickb _perl.perl6.users_ 08:00
lizmat that would be the Perl NOC 08:04
patrickb Thanks lizmat! 08:17
Xliff Is there a Raku module for generating random words? 09:23
Sort of like Silly::Werder 09:24
lizmat modules.raku.org/dist/Random::Names ?
lizmat clickbaits rakudoweekly.blog/2021/06/29/2021-26-r3/ 09:35
Xliff Looks like Inline::Perl5 is broken on latest KUbuntu 10:19
Wants libperl.so.5.30 but current is on libperl.so.5.32
And 5.30 is no longer available.
dakkar does kubuntu ship a inline-perl5 package? 10:21
moritz did you upgrade your OS after installing Inline::Perl5?
moon-child Xliff: recompile?
moritz you might need to recompile Inline::Perl5
dakkar (we're all thinkig the same exact thing 😉)
Xliff I did 'zef install --force-install Inline::Perl5' and that didn't change anything. 10:30
And I did that before mentioning anything here... ;)
dakkar ok, you're an advanced user ☺ 10:33
that's very surprising, though
next step: check that you don't have two copies installed 10:34
Xliff Hah! Yep.
Er. Nope. 10:35
Weird.
0.52 is getting installed, but 0.53 is available
I install from zef, and it says its installing 0.53 10:36
I do info, but it says 0.52 is installed.
dakkar yep, two copies in two different directories
Xliff Hrm. How can I find? 10:37
dakkar `raku -V |grep repo::chain`
should tell you where raku looks for modules
Xliff Well, it looks like I do without :from<Perl5> for now. 10:40
That doesn't help me at all. The names are all hashed.
dakkar yes, the names are, sure
but I'm pretty sure we can figure it out 10:41
what directories does that command show you?
Xliff repo::chain=inst#/home/cbwood/.raku inst#/home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site inst#/home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/vendor inst#/home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/core ap# nqp# perl5#
dakkar good, nothing too weird there 10:42
`zef list --installed` should `Inline::Perl5` twice for you 10:43
Xliff ....aaaaand....
The package came with a version of libp5helper.so precompiled
Which wanted the wrong version of perl.
dakkar ooh 10:44
Xliff Removed it and rebuilt and problem looks sorted.
dakkar++
dakkar I'm glad you fixed it!
Xliff Believe it or not, you did help a lot! Thanks. 10:56
nirnam Label.goto() not yet implemented. Sorry. 14:47
hmmmm
m6locks m: class a { has @!b; submethod BUILD ( :@c! ) { for @c -> $i { @!b.append($i); say $i; }}}; my @argg = <nsdnskf rgporkgp>; my $d = a.new(c => @argg); 15:15
camelia nsdnskf
rgporkgp
m6locks hmm I get an error with that
it says expecting any of: generic role 15:16
dakkar works here on 2021.02 (yes, I'll upgrade some day…)
m6locks I have 2021.03 15:17
dakkar where does your rakudo say the error is?
m6locks after the a
ugexe works on blead and on 2018.01
m6locks in class a
ran it again and now it seems to work
weird
dakkar which probably means you had some previous declaration that changed the meaning of that code 15:18
m6locks aye
melezhik . 15:20
.tell raydiak I've dropped some r3 tests for nested pod , maybe quite simple but still test something - gist.github.com/melezhik/859b91789...7c2000554c 15:21
tellable6 melezhik, I'll pass your message to raydiak
raydiak thank you :) 15:35
tellable6 2021-06-30T15:21:51Z #raku <melezhik> raydiak I've dropped some r3 tests for nested pod , maybe quite simple but still test something - gist.github.com/melezhik/859b91789...7c2000554c
sortiz /msg NickServ VERIFY REGISTER sortiz Of6vRqVeDghL22Ss 16:01
lizmat oops 16:02
sortiz \o #raku Is an OTP only, no problem. 16:03
El_Che otp for the win 16:12
melezhik i post some r3 tags stat, also including upcoming release if someone is interested - gist.github.com/melezhik/d214191ec...2ce3d50057 16:35
so before release is cut one call always run `tomty --only=rc_2021_07+open` to run tests against all open issues and see if they are pass .. 16:37
or just `tomty --only=rc_2021_07+open --tags` to see tags stat 16:38
that's the idea ...
perlbot nirnam pasted a new file at l.perl.bot/p/x95xhe - 17:39
nirnam I did some fiddleing with experimental.rakumod to make cached worked with hyper 17:40
and I finally did the brenchmark
nirnam it gonna carsh every time thread accessing the same cache not just modifying, so I just lock everything that have to do with cache in there 17:43
[Coke] did MasterDuke's try not work? 17:56
nirnam it blowing up on %cache.EXISTS-KEY , he only lock %caches{$key} := target(|c) 17:57
[Coke] interesting. I think he and I both thought we just needed to worry about the *set*, not the get.
I wonder if we have any benchmarks on cached we could test a new impl. again 17:58
nirnam perfomance wise, if I reverse the list before feeding it, hyper with chache is already beating just chache 18:06
not by alot, but it become apparent for very very last set of input 18:07
MasterDuke nirnam: so you modified my patch to protect the whole sub? 19:21
nirnam yeah 19:22
MasterDuke did that ever fail for you? 19:23
nirnam Didn't yet, I tried variation of the collatz function, and nothing been blowing up yet 19:24
MasterDuke have you benchmarked cached, but no hyper with the patch and without? i.e., how much does adding the lock.protect slow things down in the case where it isn't needed? 19:25
because if it's not terrible, might be worth submitting as a PR for rakudo 19:26
nirnam I didn't does anything with hyper, and hyper with cached will not work without the patch 19:27
MasterDuke well, i'd say it's worth submitting as a PR regardless, and there is a large performance drop for the non-hyper case that'd be a good cause for discussion
*if there is
nirnam Ah, in that case I should benchmark only cached without hyper, with and without patch on 19:28
MasterDuke yeah 19:30
perlbot nirnam pasted a new file at l.perl.bot/p/16zsu2 - 19:56
nirnam it does run slower with the patch
when it get to one million there's about 1 minute difference 19:57
I also used 3 lock in there, one for each time %cache is being access in your original patch 19:58
rassoc interesting how much slower cached vs manual memoization via state var is; almost 3x 19:59
nirnam I don't know if I did the manual cache right, but it about the same to me 20:02
rassoc gimme a sec, will create a gist
nirnam I can see small difference, in small input set, I can see how that could scale when there's more and more input 20:04
woo, you're right, it is about 3 times faster 20:06
rassoc gist.github.com/rassoc/7cc2d9b853f...98e9da3ab9
just the non-hyper variants
and there's a huge gap to ruby :( 20:07
nirnam and astronomical gap to C, but we don't talk about C 20:08
I tried it in C, it took .5 second for one million chain
rassoc yeah, same deal in crystal; virtually the same ruby code
moon-child tried cl (ix.io/3rBo/lisp), it's 0.7s for a million 21:57
(that's with >/dev/null; doing i/o, the terminal slows it down) 21:58
rassoc sbcl? can't reproduce, way slower for me 22:05
moon-child yeah, sbcl 22:06
ix.io/3rBx 22:07
rassoc but it might just be the slowpoke toaster i'm running this on
rassoc yeah, that's what i'm doing; 1.81 s, 228660 kb 22:08
moon-child I get similar times on my old crappy laptop 22:09
moon-child rassoc: note the cl is going up to a million, raku just doing 100k 22:09
rassoc sure, and this is ruby with 1mil: 2.11 s, 169560 kb 22:10
not THAT bad
rassoc raku is still crunching ;) 22:10
moon-child heh, that one took me 1-2 minutes 22:11
rassoc typing didn't help at all. was curious whether uint annotations would help, but those aren't implemented for hashes just yet 22:12
moon-child I would try using a buf32 instead of a hash, and just falling back if it's out of range 22:29
rassoc try it, hehe. raku did swap like crazy for me :) 22:33
moon-child oh it'll autoexpand
rassoc yeah, max key is 1570824736 for 100k 22:34
japhb Commented with a micro-opt 22:39
japhb BTW, gist.github.com/rassoc/7cc2d9b853f...l-raku-L12 forces constant type coersions from Num to Int. 22:40
(Because 1E5 is a Num, not an Int) 22:41
rassoc initial solution isn't mine 22:42
seeing 2.19 s, 154772 kb for yours; slick
that's ruby's runtime for a 1mil seq 22:43
japhb Err, wasn't claiming it was, just explaining for those who wondered why that variant was so slow.
rassoc 1.7s even; system had load 22:44
welcome to the club of crappy i3 machines ;)
japhb Heh 22:46