🦋 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.
00:06 pecastro left 00:56 redhands joined
redhands quick question: did nqp::getcomp get renamed? nqp::getcomp("perl6") seems to be returning null object, and I think it was working about a year or so ago. 00:57
01:06 Geth left 01:16 kvw_5 joined 01:19 kvw_5_ left 01:24 parv left 01:25 krkini left 01:26 kini joined 01:33 APic joined 01:51 [Sno] joined 01:52 |Sno| left 02:03 frost-lab joined 02:08 imcsk8 left 02:51 parv joined 03:04 mowcat left 03:52 kini left 03:53 kini joined 03:57 voidname joined 03:58 Black_Ribbon left 04:00 monkey__ joined
voidname Hello, everyone. I'm halfway through raku course (course.raku.org) and noticed the PART 2 - PART 5 of the course are not available. It seems to contain some import topics that are not covered in PART 1. Can anyone point me to the resources where I can learn those things (networking, object oriented programming, etc.,). Raku is the first programming language I'm learning. 04:02
04:02 tejr left 04:03 tejr joined
moon-child iirc raku.guide/ was decent, and covers some of those 04:04
voidname thanks! 04:08
04:19 monkey__ left 04:30 voidname left 04:33 softmoth_ left 04:35 neshpion left
moon-child m: say + (True|False); say ? (True|False) 04:38
camelia any(1, 0)
moon-child why does ? collapse but + doesn't?
04:51 maggotbrain left 04:53 maggotbrain joined 05:19 jmerelo joined 05:21 Sgeo_ joined 05:22 Sgeo left 05:47 APic left 05:49 clarjon1 joined 05:56 wamba joined, ufobat_ joined 06:03 ufobat_ left 06:17 [Sno] left 06:19 sno joined 06:22 parabolize left 06:26 APic joined 06:31 stoned75 joined 06:56 parvXirc joined, parvXirc left 06:58 parv left 07:10 domidumont joined
moritz_ because junctions are designed to be used in boolean context 07:24
andinus m: say 1^2 07:25
camelia one(1, 2)
andinus what is happening here?
tyil andinus: docs.raku.org/type/Junction 07:27
andinus ah, i was thinking ^ is ** 07:29
07:49 dakkar joined
MasterDuke m: use nqp; dd nqp::getcomp('Raku') # redhands it's now followed the language name change 07:58
camelia (Perl6::Compiler without .raku or .perl method)
08:03 Sgeo_ left, sno left 08:04 rindolf joined 08:09 domidumont left 08:11 pecastro joined 08:21 kini left 08:22 kini joined 09:12 aborazmeh joined 09:19 dogbert11 joined 09:21 dogbert17 left 09:24 wamba left 09:25 aborazmeh left
andinus what module should i use for sha1? 09:27
modules.raku.org returns github.com/bduggan/p6-digest-sha1-native
09:38 linkable6 left 09:39 linkable6 joined 09:42 dogbert17 joined 09:45 dogbert11 left 09:58 MasterDuke left, MasterDuke joined 10:14 rindolf left 10:16 aborazmeh joined 10:23 ctilmes joined
ctilmes andinus: Gcrypt does SHA1, but requires an external dependency (libgcrypt) github.com/CurtTilmes/raku-libgcry...igest-hash 10:25
tellable6 2021-03-21T17:23:54Z #raku <El_Che> ctilmes: \o/
10:28 abraxxa left 10:30 abraxxa joined 10:31 kini left 10:32 kini joined 10:52 aluaces left 10:57 wamba joined 11:00 aborazmeh left 11:05 ctilmes left, ctilmes joined 11:09 ctilmes left 11:13 aindilis` joined 11:14 aindilis left 11:31 frost-lab left 11:42 aluaces joined 11:52 domidumont joined 11:57 aborazmeh joined 12:03 stanrifkin joined 12:04 kini left
stanrifkin can i load a file into the repl so i can test a sub already written in the file? 12:04
12:05 kini joined
andinus yes, start the repl with `raku -Ilib` -- lib being the directory that file is in 12:09
lizmat japhb: www.reddit.com/r/rakulang/comments...e_in_raku/ 12:11
stanrifkin andinus: i thought of something like haskell where i can load a file and test some functions. i found EVALFILE but the function is not visible after execution. 12:13
12:20 aborazmeh left
stanrifkin raku.org mainpage still got a dead link under "more.." to example.perl6.org 12:21
MasterDuke perhaps `require 'filename';` first? 12:22
stanrifkin MasterDuke: will eval the file but subroutine isn't visible after that 12:24
MasterDuke any change if the sub has `is export`? 12:25
stanrifkin MasterDuke: maybe i put into a package and call full qualified name
MasterDuke: how to do that? 12:26
MasterDuke m: sub a($b) is export { say $b } 12:27
camelia ( no output )
12:27 parv joined, parv left 12:28 parv joined
stanrifkin MasterDuke: still doesn't work 12:28
MasterDuke sorry then, i'm out of ideas (besides creating a package/module for it), but the repl does have a bunch of known problems, maybe that's one of them 12:29
stanrifkin MasterDuke: i've got a simple fibonacci function here in a file. i want to call it with different arguments after it's loading into the repl
MasterDuke: no problem. i can run the file several times with changes or user input. i just thought about it, it could work like in haskel or lisp here 12:30
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/04/13/2021-...irst-conf/ 12:52
sena_kun lizmat++ 12:56
jmerelo lizmat++ 13:13
13:17 jmerelo left 13:20 abraxxa left 13:24 abraxxa joined 13:28 aborazmeh joined, albino_ is now known as albino 13:34 abraxxa left 13:36 abraxxa joined, PimDaniel joined
PimDaniel o/ 13:36
I've got this:
String corruption detected: bad storage type in regex at /home/moi/raku/lib/.precomp/4A9B532DFE94A32567D38B422D487A96BD587829/68/68595D13809D9D2A55564C010C9CB7A66F1166DB line 1 13:37
And occurs randomly. 13:38
13:39 ufobat joined, aluaces left
PimDaniel I just make a regexp that works most of the times but sometimes i get this strange error. 13:40
13:40 abraxxa left, aborazmeh left
El_Che error is indeed LTA 13:40
13:41 abraxxa joined
dakkar that feels like time for a debug build of moarvm and running under valgrind… ugh 13:41
PimDaniel El_Che : LTA???
El_Che Less Than Awesome
dakkar "Less Than Awesome" 13:42
PimDaniel Ok thank's.
13:43 kini left
PimDaniel May be a new version of Raku? 13:44
13:45 kini joined
MasterDuke i don't think i've ever seen that error before. could you share the code? 13:45
PimDaniel YES: I must control if this is not due to a Null string before. 13:46
13:49 PimDaniel left 13:56 gfldex left 13:57 gfldex joined 14:03 gfldex left, gfldex joined 14:19 stanrifkin left 14:24 aborazmeh joined 14:26 Sgeo joined 14:27 softmoth_ joined 14:33 ufobat_ joined 14:36 ufobat left 14:46 rindolf joined 14:49 parabolize joined 14:52 _jrjsmrtn left 14:53 __jrjsmrtn__ joined, wamba left 14:54 wamba joined 14:56 abraxxa left 14:58 abraxxa joined 15:06 aluaces joined 15:10 softmoth_ is now known as softmoth 15:25 kst left 15:26 kini left 15:28 PimDaniel joined, kini joined 15:29 aborazmeh left
PimDaniel I come back on my problem: Sometimes raku crashes : segfault. 15:30
Did someone allready saw crashes with Str.math routine?
here's the line: my $match = $k.match(/^ \d+ '_' (\d+) '-' \d+ '_' (\d+) $/); 15:31
for %vmis_pts.keys -> $k { my $match = $k.match(/^ \d+ '_' (\d+) '-' \d+ '_' (\d+) $/); ... } 15:32
I'm Very sure $k is an Str. 15:33
Erreur de segmentation 15:34
15:36 PimDaniel left 15:38 PimDaniel joined
PimDaniel i must correct : Str.match NOT Str.math 15:39
Sometimes i get that: indexingoptimized requires a concrete string, but got null. ???? 15:46
lizmat PimDaniel: sanity check: which version of Rakudo are you using ? 15:47
PimDaniel Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2020.10. Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d Built on MoarVM version 2020.10. 15:50
15:53 aindilis` left
PimDaniel I think my loops many times : my code is not optimized but i should not have this kind of error. 15:53
15:54 aindilis joined
lizmat agree with you you shouldn't have this type of error 15:55
but 2020.10 is 5 months old and a lot has been improved re stability since then
is there a chance you could check whether that still is an issue with 2021.03 ?
PimDaniel Okay i'll upgrade may version and check... don't remerber where we grab the source? 15:57
may we uninstall last version? 15:58
16:01 aborazmeh joined
PimDaniel Question of the same order: Is there an apt link for Debian? 16:02
16:02 ufobat_ left
PimDaniel It should be faster, no? 16:02
I would.
MasterDuke El_Che: ^^^
PimDaniel: github.com/nxadm/rakudo-pkg 16:03
16:06 abraxxa left 16:07 abraxxa joined
PimDaniel MasterDuke thank's but i do not know to which question you reply. 16:08
Raku debian package or raku npm package? more questions : Is that version the latest one, Stable? or Rolling Release? 16:09
MasterDuke that repo has instructions on how to get an updated apt for debuan
16:18 PimDaniel left 16:22 PimDaniel joined
PimDaniel Before all : is there a way to remove properly my precedent binary distro? 16:23
I made the debian process but did not install yet.
MasterDuke something like `apt remove rakudo` should do it, but i think just upgrading the current one should be fine 16:24
PimDaniel The older one has nothing to do with apt.
It's a binary package. 16:25
MasterDuke oh, you mean just a .tar.gz or something like that?
PimDaniel Yes!
I made a rakudo-star-2020.10 folder which is still here. 16:26
MasterDuke just delete that folder is probably sufficient
PimDaniel No no : i have many things into my /usr/local/ Tree 16:28
16:28 kini left 16:29 natrys joined, kini joined
PimDaniel Ok i remember: i have a rakudo-star-2020.10/src/moarvm-2020.10/MoarVM-2020.10 subdir with a ./Configure.pl perl Script. 16:30
and the README that i was looking for. 16:31
But nothing helps : no uninstall target. 16:33
16:34 dakkar left
MasterDuke what the value of PREFIX in the Makefile in your MoarVM subdirectory? 16:35
PimDaniel I cannot see the Makefile. 16:36
MasterDuke in any of the directories/subdirectories? 16:37
PimDaniel Ok i had to run ./Configure again.
prefix is /home/moi/Downloads/rakudo-star-2020.10/src/moarvm-2020.10/MoarVM-2020.10/install/ 16:38
I thing i changed prefix
whith an argument 16:39
MasterDuke whatever you'd given as the prefix is all you should have to delete
PimDaniel Yess but it's never perfect work that way. 16:41
You can suppress important things. 16:42
I'll refer the the install target.
16:49 PimDaniel left 16:55 aborazmeh left 17:04 aborazmeh joined
redhands nevermind, this seems to do it: nqp::getcomp("Raku") 17:07
17:12 PimDaniel joined 17:17 PimDaniel left 17:24 stoned75 left 17:26 stoned75 joined 17:29 kini left 17:31 kini joined, aborazmeh left 17:32 PimDaniel joined, mowcat joined
PimDaniel lizmat I intalled new version but the bug remains.: Segmentation fault. 17:33
lizmat PimDaniel: then please, "show us the code", possibly after you've been able to golf it 17:34
PimDaniel what means golf?
lizmat making the code smaller while still showing the problem (in this context) 17:35
it comes from: en.wikipedia.org/wiki/Code_golf 17:36
18:09 natrys left 18:10 domidumont left 18:16 aborazmeh joined 18:36 natrys joined
PimDaniel ok thanks lizmat. 18:42
18:44 wamba left
PimDaniel I'll make a few tests to understand what context produces the crash. If i found. i'll make a golf. 18:44
otherwise i'll publish a whole committed version. 18:45
18:45 PimDaniel left 18:48 mahafyi joined 18:51 stoned75 left 18:55 ggoebel joined 18:57 ggoebel left 18:58 kini left 18:59 wamba joined 19:00 kini joined 19:01 mahafyi left 19:02 mahafyi joined 19:03 stoned75 joined 19:12 abraxxa1 joined 19:15 MasterDuke left, MasterDuke joined 19:16 Doc_Holliwood joined
Doc_Holliwood weekly: my comment under www.youtube.com/watch?v=6X2D497is6Y 19:17
notable6 Doc_Holliwood, Noted! (weekly)
19:17 mahafyi left, abraxxa1 left 19:19 abraxxa1 joined 19:20 mahafyi joined 19:21 stoned75 left
lizmat Doc_Holliwood: so many comments ? 19:26
didn't find yours
and how to link to yours ?
19:27 Sgeo left, Sgeo joined
Doc_Holliwood hold on 19:27
twitter.com/HrBollermann/status/13...9383468032 19:30
I'm afraid it's not possible to link a comment
on YT
lizmat yeah.. ok, cool!
I will see it when parsing the #rakulang stream 19:31
19:37 Doc_Holliwood left 19:40 Doc_Holliwood joined
japhb lizmat: Thank you for the pointer to that Reddit question. It was finally enough to convince me to create a Reddit account after all these years so I could answer it. :-) 19:41
lizmat japhb++ 19:42
19:42 PimDaniel joined
PimDaniel lizmat : i've found the problem which has nothing to do with the line error: 19:43
I was building a new key on a hash that i was parsing with for.
It produced a memory problem that dit not indicate the true error. 19:44
lizmat did you do this from multiple threads at the same time ? 19:45
PimDaniel for %h.keys { $h{<newkey>} = something;} 19:46
lizmat: I struggle to reply to your question since i do not really know when new tread is created in Raku.
lizmat what is $h in that example ? 19:47
also, {<foo>} feels wrong 19:48
PimDaniel Hooo i mean %h
lizmat you probably meant %h<foo> then ?
PimDaniel YES
lizmat how big is the %h hash originally ?
in number of keys ? 19:49
PimDaniel Very small: but hash was feeding when it was parsing itself at the self time.
lizmat very small means < 10 ? 19:50
PimDaniel In my algorithm hash is here just to catch back keys.
lizmat and the newkey is always a constant? or is it somehow dependent on the key ?
PimDaniel YES less than 10
19:52 |oLa|1 joined
PimDaniel The new key is produced by existing keys produced before into a precedent loop but new keys have a complete different form and they are filtered by the math function. 19:52
19:53 |oLa| left
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 } # would this describe your situation ? 19:53
camelia concatenate requires a concrete string, but got null
in block <unit> at <tmp> line 1
lizmat wow, that's interesting, doesn't do that locally
m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 }
camelia ( no output )
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 }
camelia ( no output )
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 }
camelia ( no output )
PimDaniel I'll paste the piece of code tomorrow : it's late for me.
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 } # foo
camelia ( no output )
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 } # foo
camelia ( no output )
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 } # foo
camelia ( no output )
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys { %h{$_~$_} = 42 } # foo 19:54
camelia ( no output )
19:54 rindolf left
lizmat PimDaniel: whenever you're ready :-) 19:54
PimDaniel my loop is imbricated and i use Str.match function.
I'll reproduce it tomorrow morning : the problem is to have a chunk of datas for it. 19:55
Well i do not know what is the expected behavior in this case : feeding during parsing.
I'd say at first: it should not crash : this should be controlled. 19:56
lizmat I agree
PimDaniel But many langages do not accept this, i do not even know for Perl7. 19:57
lizmat m: my %h = "a" .. "e" Z=> 1..5; for %h.keys.eager { %h{$_~$_} = 42 } 19:58
camelia ( no output )
lizmat key.eager could be a workaround for now
it would fetch all current keys before keys are being added
PimDaniel May be use a random generator : it depends of datas 19:59
Also it occured when i used Str.match function : it's probably a memory bypass on match because match uses a few memory and for sure malloc or calloc underneath i think. 20:00
Ok good night : i'll track this tomorrow. 20:01
20:02 PimDaniel left
lizmat My guess for now is that adding keys while *lazily* iterating over a hash, may be a case of DIHWIDT 20:02
20:09 natrys left 20:15 neshpion joined, neshpion left 20:16 neshpion joined 20:23 brtastic joined 20:28 parv left 20:32 mahafyi left 20:39 b2gills left 20:40 b2gills joined
El_Che PimDaniel: rakudo-pkg can be installed next to rakudo supplied by the OS if you want to 20:45
tellable6 El_Che, I'll pass your message to PimDaniel
21:08 Black_Ribbon joined 21:12 brtastic left 21:21 aborazmeh left, dogbert11 joined 21:24 oftl joined
guifa lizmat: I noticed on the weekly that you did some work on user-added subclasses of Str 21:24
lizmat well, I worked on Str, Cool and Allomorph to transparently allow for subclasses of Str, indeed
21:25 dogbert17 left
lizmat m: class A is Str { method foo() { dd } }; my A() $a = "bar"; $a.foo 21:25
camelia method foo(A: *%_)
guifa A() ! 21:26
I was trying to figure out how to create subclasses, because nothing was working for instantiating
m: class Foo is Str { }; my Foo $a = 'a';
camelia Type check failed in assignment to $a; expected Foo but got Str ("a")
in block <unit> at <tmp> line 1
guifa m: class Foo is Str { }; my $a = Foo.new: ‘a’; 21:27
camelia Default constructor for 'Foo' only takes named arguments
in block <unit> at <tmp> line 1
lizmat but now with the new coercion syntax, it is much easier! 21:28
I figured it would make some people happy :-) 21:29
guifa Yeah. I had for a while thought about just making LanguageTag be a subclass of Str, but I decided in practice, providing a solid .Str worked basically as well
lizmat well, for the future, it could change the API for stuff like that 21:36
guifa: another approach:
m: class A is Str { method foo() { dd } }; my constant Str = A; my $a = "bar"; $a.foo # aka "lexical refinement" 21:37
camelia method foo(A: *%_)
21:38 kini left
guifa That won’t work for modules though right? Since the Str symbol will already be in scope and export can’t overwrite things in the symbol table, just add to it? 21:39
21:39 kini joined
lizmat well..... that would be a bridge to cross :-) 21:40
I mean, if I can do it without a use statement, I should be able to do that *with* a use statement as well?
I mean, exports *are* lexical 21:41
so technically, it wouldn't be overwriting, just adding a symbol already known globally, in the lexical context of the "use" statement 21:42
guifa It would be a little weird though. Because if my use replaces Foo with Bar, if Bar isn’t a subclass of Foo, then I can see that causing all sorts of issues
lizmat well, with great power comes great responsibility 21:43
guifa True
Drop in class replacement is something that has to be done very carefully — I can’t think of anyone other than me that’s tried to, and whiel mine works and plays nicely, I still feel like I’m doing something I shouldn’t be lol 21:44
lizmat mind you, it is *not* class replacement 21:46
guifa Yeah, not at the technical level. But it would appear that way to the module user
lizmat m: sub ok() { say "foo" }; { use Test; ok 42 }; ok 42
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling ok(Int) will never work with declared signature ()
at <tmp>:1
------> 3k() { say "foo" }; { use Test; ok 42 }; 7⏏5ok 42
lizmat m: sub ok($a) { say "foo" }; { use Test; ok 42 }; ok 42
camelia ok 1 -
lizmat outer "ok" is hidden, but only *inside* that scope 21:47
well, users need to realize that "use" is lexical 21:48
and that's hard for people coming from Perl
but yeah, it *is* something that needs to be taught and learned
21:49 neshpion left 21:53 wamba left 22:03 dogbert11 left 22:07 aluaces left 22:11 dogbert11 joined 22:17 abraxxa1 left 22:18 dogbert11 left, dogbert11 joined, Doc_Holliwood left 22:23 Doc_Holliwood joined 22:28 dogbert11 left 22:29 dogbert11 joined 22:33 abraxxa left 22:36 dogbert17 joined, abraxxa joined 22:38 dogbert11 left 22:40 dogbert11 joined 22:43 dogbert17 left, dogbert17 joined 22:46 dogbert11 left 22:57 dogbert17 left 22:58 dogbert17 joined 23:04 Doc_Holliwood left 23:07 Doc_Holliwood joined 23:23 parv joined 23:29 kini left 23:31 kini joined 23:33 pierrot left 23:39 abraxxa left 23:43 abraxxa joined 23:44 abraxxa left 23:45 abraxxa joined 23:47 dataangel joined 23:52 MasterDuke left 23:54 pecastro left 23:56 pierrot joined