🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 8 June 2022.
00:08 reportable6 left 00:10 reportable6 joined 00:34 Kaiepi left, Kaipei joined 00:36 p6steve left 00:38 p6steve joined 00:47 frost joined 01:47 reportable6 left, notable6 left, statisfiable6 left, bisectable6 left, nativecallable6 left, bloatable6 left, tellable6 left, greppable6 left, committable6 left, coverable6 left, releasable6 left, unicodable6 left, shareable6 left, quotable6 left, sourceable6 left, benchable6 left, linkable6 left, evalable6 left, unicodable6 joined 01:48 tellable6 joined, sourceable6 joined, releasable6 joined, committable6 joined, coverable6 joined, nativecallable6 joined, linkable6 joined, reportable6 joined, shareable6 joined, bloatable6 joined 01:49 greppable6 joined, benchable6 joined, statisfiable6 joined, bisectable6 joined 01:50 quotable6 joined, notable6 joined, evalable6 joined
theangryepicbanana had a random thought today: should `andthen` bind tighter than `orelse`? 01:55
scratch that, now I'm reconsidering why `orelse` exists at all 01:56
obviously `$<foo> andthen .made orelse foo()` looks like decent code, but apparently `orelse` also sets `$_` (like `andthen`) so you can't just have a normal expression there 01:57
`$<foo> andthen .made or foo()` is fine.. but is less than ideal in the case that `.made` returns a falsey value (as there is no keyword version of `//`)
am I missing something or maybe this should be re-looked? 01:58
Voldenet there aren't many uses of andthen 02:15
m: my $p = ((2).first: *.is-prime andthen * * 2 orelse 42); say $p 02:16
camelia 4
Voldenet design docs don't really say what's it for either 02:22
theangryepicbanana Voldenet: I use `andthen` for handling `Nil`, like in my example 02:26
my question is about `orelse` though, which is not necessarily useful as `$_` will always be `Nil`
Voldenet I'm trying to find sane use for it and I fail 02:30
Util Voldenet: Scanning my repo, I see that @wambash has used `andthen` in 124 of the Weekly Challenge problems. 02:42
That style is not at all to my own taste, but "to each their own".
This script has the record of 11 `andthen` statements; maybe you will find it sane, even if not to your liking:
github.com/manwar/perlweeklychalle.../ch-1.raku 02:43
02:50 evalable6 left, linkable6 left
theangryepicbanana it looks like they're using `andthen` in place of `==>` or some sort of smalltalk-like cascade operator 02:51
02:51 linkable6 joined
or like a pipe operator 02:51
anyways I think `Nil` is a good usecase for `andthen
anyways I think `Nil` is a good usecase for `andthen` 02:52
02:52 evalable6 joined
Voldenet hm, it's somewhat weird to read 03:01
03:15 [Coke] left 03:17 [Coke] joined
theangryepicbanana it is, I wish I could use .? instead like in other languages 03:24
04:05 jmcgnh_ joined 04:06 jmcgnh left 04:09 jmcgnh_ is now known as jmcgnh 05:09 committable6 left, statisfiable6 left, nativecallable6 left, bloatable6 left, unicodable6 left, tellable6 left, reportable6 left, shareable6 left, sourceable6 left, releasable6 left, quotable6 left, benchable6 left, evalable6 left, greppable6 left, linkable6 left, bisectable6 left, coverable6 left, notable6 left, committable6 joined, bisectable6 joined, nativecallable6 joined 05:10 shareable6 joined, greppable6 joined, bloatable6 joined, sourceable6 joined, evalable6 joined, unicodable6 joined, notable6 joined 05:11 tellable6 joined, releasable6 joined, linkable6 joined, benchable6 joined 05:12 quotable6 joined, statisfiable6 joined, coverable6 joined, reportable6 joined 05:22 Xliff left 06:08 reportable6 left 06:09 reportable6 joined
Nemokosch I don't find it weird to read and anyway I like the Krňávek style myself 06:10
Tbh the feed operator sounds nice in theory but it's underwhelming both because of the fake parens it requires and even more importantly because of its bad compatibility with method calls 06:15
06:27 amenonsen left 06:28 amenonsen joined 06:30 mexen joined 06:52 frost left 07:10 abraxxa joined 07:15 abraxxa left, abraxxa joined 07:22 [Coke] left 07:26 jjido joined 07:27 Sgeo left 07:28 [Coke] joined 07:48 dakkar joined 07:53 jjido left 08:07 lichtkind_ joined 08:09 rrmm joined
rrmm m: say 5; 08:10
camelia 5
08:10 rrmm left
Voldenet "I see. 5 is indeed 5" 08:17
moon-child feedback for whoever is in charge of implementing the bot: it would be cool if, when there is no printed output, it would display the result of the expression being evaluated 08:18
Nemokosch lol 08:20
moritz we've had that in the past. It confused the heck out of people :D 08:22
moon-child why?
moritz we even had OUTPUT vs RESULT
moon-child I mean, presumably it would display differently (cf 'no output; result: whatever') 08:23
moritz dunno, humans are weird.
moon-child and don't display result in the case where there was an output
08:24 frost joined
Nemokosch not like it's a huge deal to write dd in front of a line... 08:29
09:04 frost left
moritz a bit off-topic, but please bear with me. A friend of mine needs some survey data on agile retrospectives for her Bachelor's thesis: www.soscisurvey.de/retrospective/ 09:04
if you have retrospectives at $work, please fill out the survey, and maybe even ask your co-workers too. 09:05
(I know her personally, and can vouch for her integrity)
09:33 lizmat_ joined, RakuIRCLogger left, Geth__ joined
Nemokosch 👍 09:34
09:35 Geth left, lizmat left, lizmat_ is now known as lizmat, Geth__ left 09:36 Geth joined
lizmat PSA: the weekly may be delayed today due to circumstances 09:55
afk for at least a few hours&
Nemokosch I think RZ should work 09:57
m: dd (1, 2) Z (3, 4); dd (3, 4) RZ (1, 2);
come ooon
lizmat m: dd (1, 2) Z (3, 4); dd (3, 4) RZ (1, 2);
camelia ===SORRY!=== Error while compiling <tmp>
Missing infix inside R
at <tmp>:1
------> dd (1, 2) Z (3, 4); dd (3, 4) RZ⏏ (1, 2);
expecting any of:
infix stopper
Nemokosch it thinks that Z is a meta-operator here 09:59
same with X
10:22 djerius left, djerius joined 10:45 xinming left 10:47 xinming joined 10:48 frost joined 11:06 frost left 11:13 frost joined 11:25 frost left 11:36 frost joined
[Coke] is there a way to tell irssi to not show me everyone's name when I join the channel? (when you are disconnected and reconnected frequently, this generates a LOT of noise, esp. in this channel) 11:42
sienet_ja_LSD[m] set this off irssi.org/documentation/settings/#...es_on_join 11:43
11:46 [Coke] left, [Coke] joined
[Coke] Thanks! 11:46
sienet_ja_LSD[m] aye
[Coke] Now to also fix my network issues so the router doesn't keep disconnecting. :)
11:58 frost left, frost joined 12:08 reportable6 left 12:11 reportable6 joined 12:17 frost left 12:25 frost joined 13:00 frost left 13:15 jgaz joined 13:27 Sankalp left, Sankalp- joined 13:28 Sankalp- is now known as Sankalp 13:42 frost joined 13:59 djerius left 14:06 frost left
patrickb I currently get ===SORRY!=== Error while compiling /home/patrickb/repos/RakudoCIBot/service.raku 14:28
===SORRY!=== Error while compiling /home/patrickb/repos/RakudoCIBot/lib/RakudoCIBot.rakumod (RakudoCIBot)
===SORRY!=== Error while compiling /home/patrickb/repos/RakudoCIBot/lib/Routes.rakumod (Routes)
Earlier failure:
Failed to open file /home/patrickb/.raku/precomp/718FC9CCD6677616D6F178DCF5B56F8D1CAA3D9E/28/287E340591A8C5DE2625947EEC5BEFDF29E8EA4F: Too many open files
in any statement_control at /home/patrickb/.rakubrew/versions/moar-2022.04/install/share/perl6/lib/Perl6/Grammar.moarvm line 1
Final error:
Type check failed in binding; expected IO::Handle but got Failure (Failure.new(exceptio...)
at /home/patrickb/repos/RakudoCIBot/lib/Routes.rakumod (Routes):10
at /home/patrickb/repos/RakudoCIBot/lib/RakudoCIBot.rakumod (RakudoCIBot):15
aw. I didn't mean to paste.
Anyways. I currently get the above error whenever I start the RCB locally without first deleting .precomp/. 14:29
Is this a known failure mode?
14:35 jjido joined 14:40 djerius_ joined 14:41 Sgeo joined
nine What files are open at that point? 14:45
patrickb Hm... How do I find out? 14:48
strace? 14:49
nine make it stop on that error (by adding a large sleep in the code or simply running in gdb) and lsof 14:53
Or just look into /proc/<pid>/fd
patrickb on it. 14:54
Am I specially skilled to hit annoying errors in Raku or do most people tend to work around such bugs instead of fixing them? 14:58
14:59 jjido left
nine I'd bet on the latter 14:59
sienet_ja_LSD[m] I encountered a similar error on OpenBSD 15:05
guifa the too many open files can happen sometimes with zef install. I looked into a while back but couldn't quite track down the cause but for very large modules sometimes it comes up 15:07
and by zef install, I'm assuming the error itself is somewhere in Rakudo 15:08
try running ulimit -n X where X is a large integer
On macOS, the max open files is only 256, and so it causes problems. Try 4096 or something and see if it goes away 15:09
patrickb ok. ulimit -n == 1024 15:21
And that process actually does hit that limit. With some rare exceptions it's all precomp files it has opened.
guifa I think this is probably something that's less a bug and more something inelegant that Rakudo is doing, but until very recently no one was writing code that would hit the limit 15:22
sienet_ja_LSD[m] projects getting larger 15:23
patrickb Thinking about it, it seems plausible for the compiler to have many precomp files open in parallel and 1024 is not a particularly high limit. 15:24
I wonder where a good place to document this would be. 15:25
patrickb posts a SO question
15:59 linkable6 left, evalable6 left
patrickb There we go: # Increase nofile soft from the default of 1024. 15:59
Argh! 16:00
16:00 evalable6 joined 16:01 morte_ joined 16:02 linkable6 joined
jgaz What's the difference between the books "Think ~~Perl 6~~ [Raku]" and "Learning ~~Perl 6~~ [Raku]"? 16:05
guifa patrickb: ah, you're using Red and Cro. Totally makes sense. Each of those tends to break out each individual class/role into distinct files. I was actually strangely hitting it in Intl::CLDR with %?RESOURCES (I "only" had about 100 classes, but easily a thousand resource files) 16:06
16:15 perlbot left 16:17 perlbot joined 16:20 RandalSchwartz joined, RandalSchwartz left 16:30 jjido joined 16:34 mexen left 16:36 dakkar left
patrickb jgaz: Think Perl6 is an introduction into Programming in general. So it's good for people that have no prior programming experience. 16:45
jgaz: Learning Perl6 is focused on Raku as a language. So you get a lot more Raku and a lot less "how to computers and programming in general work" 16:48
moritz the "Think" book is more basics, more... mathematical? maybe
both assume no prior programming experience, I think
whereas "Raku Fundamentals" (my book) assumes prior experience with programming languages, maybe even dynamic languages, and doesn't explain what a variable, a loop, a string, an array etc are 16:49
patrickb (IIRC Think Perl6 is a "translation" of Think Python, with Python being substituted with Raku. Note that this isn't a bad thing! Just reinforces that the primary focus of the book is not on Raku alone.) 16:52
andinus can we split a class in multiple files? (multiple large submethods) 16:53
jgaz moritz: yeah, I have your book too. Also, the kindle version of one of your books has a bug. I think it's the grammars book. Almost everything is in bold.
I emailed the publisher about it, but it may not have gone anywhere. 16:54
guifa andinus: no. You can put multiple classes in a single file, but not the other way around. That said, depending on what's in your class, it may be possible to factor some of it out and toss it into a module to be imported in 17:01
andinus i see 17:02
guifa If you have internal classes/roles, those are the first things I'd pull out. If you have any lexical subs, those are easy to pull out as well 17:06
17:08 finanalyst joined
Nemokosch Does anyone know anything about the RZ and RX issue? 17:09
namely that they don't work because it's interpreted as some unfinished meta
finanalyst I'm trying to upload a module using fez, without success. I've logged in, and getting 'hey you did it..." but not the name of the module
tellable6 2021-02-10T12:07:00Z #raku <patrickb> .tell finanalyst I just noticed all the work you have done in the area of pod rendering. Do you think it makes sense / is possible to integrate into one of our module webpages?
finanalyst patrickb: where is everyone? 17:12
patrickb o/ 17:13
finanalyst: Who are you looking out for?
finanalyst patrickb: you actually. You sent me a message in Feb. I just got some time to od raku 17:14
Also, I'm trying to get a module on to fez, but failing
[Coke] \o 17:15
finanalyst Coke: Hi. I'm trying to get a module into the Ecosystem via fez. I've looked at the documentation, but can't find my error 17:20
17:22 RandalSchwartz joined
patrickb finanalyst: What makes you think the upload didn't work? The "hey you did it..." sounds rather positive. 17:27
finanalyst patrickb: yes, but according to the documentation, fez should give feedback about the name of the module. 17:28
Also, when I run 'fez list' I get a zero response 17:29
sienet_ja_LSD[m] zef
17:42 RandalSchwartz left
[Coke] What's the name of the module? 17:46
Nemokosch Uh oh... something annoyingly similar to shell... moment 17:52
m: if 0 { say "Blah"; }⏏ say "Just kidding"; 17:53
spoiled it
17:54 Nemokosch joined
Nemokosch m: if 0 { say "Blah"; } say "Just kidding"; 17:55
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> if 0 { say "Blah"; }⏏ say "Just kidding";
Nemokosch m: if 0 { say "Blah"; }; say "Just kidding";
camelia Just kidding
Nemokosch Seriously? 😩 Are all blocks just statements hidden behind goddamn automatic semicolon insertion?
finanalyst Coke: CWT-Repository-Hash 18:02
18:05 morte_ left 18:07 reportable6 left 18:08 vrurg joined, vrurg_ left 18:09 Nemokosch left, reportable6 joined
[Coke] not exactly. but yes, terminating a block on a line avoids the need for a ; 18:28
finanalyst Coke: Found reason for failure of my module to upload to fez. Errors in META6.json 18:29
18:33 morte_ joined
Nemokosch Well this explains the embedded block weirdness 18:34
that a block of a map could terminate the whole statement
if this is how blocks behave in general...
[Coke] if the block is the last thing in the map statement, yes. 18:40
18:47 kaskal joined 18:48 kaskal- left 19:00 lichtkind__ joined 19:03 lichtkind_ left 19:18 mexen joined
p6steve patrickb: gets hit by the SO fuzz 19:23
patrickb p6steve: Ah, hm, interesting. I wonder on which SO site this would be on-topic. Unix & Linux? 19:33
19:41 jcallen_ is now known as jcallen 20:06 jjido left 20:10 jjatria left, JRaspass left, jjatria joined, JRaspass joined
lizmat PSA: the Rakudo Weekly News will be published tomorrow 20:36
20:50 jjatria left, JRaspass left, jjatria joined, JRaspass joined 20:52 abraxxa left
Nemokosch what does PSA mean? 20:52
lizmat Public Service Announcemenr
Nemokosch oh 😄 20:54
21:19 jgaz left
Anton Antonov @lizmat Thank you for your efforts! 22:00
22:19 evalable6 left, linkable6 left 22:20 evalable6 joined 22:21 linkable6 joined 22:22 morte_ left
Nemokosch why does this 22:38
22:38 mexen left
m: dd [+] $(1, 2, 5, 7) 22:38
work as expected (summing the elements) 22:40
m: dd [\+] $(1, 2, 5, 7)
for better record:
22:42 Nemokosch joined
Nemokosch m: `dd [+] $(1, 2, 5, 7)` 22:42
camelia ===SORRY!=== Error while compiling <tmp>
Bogus statement
at <tmp>:1
------> <BOL>⏏`dd [+] $(1, 2, 5, 7)`
expecting any of:
statement list
Nemokosch bruh 22:43
moon-child m: dd [+] $(1, 2, 5, 7)
camelia 15
moon-child m: dd [\+] $(1, 2, 5, 7)
camelia ($(1, 2, 5, 7),).Seq
moon-child no `
Nemokosch so yeah
[+] didn't care for the scalarness, apparently
at least it's not the same value  infix:<+> would return 22:44
m: dd infix:<+> $(1, 2, 5, 7)
camelia 4
Nemokosch [\+] did, however
22:47 JRaspass left, jjatria left 22:49 jjatria joined, JRaspass joined 22:55 Nemokosch left
Nemokosch github.com/rakudo/rakudo/issues/4955 22:55
and now I managed to cause segfault xD 22:56
22:57 lichtkind__ left 23:05 Altai-man joined 23:07 sena_kun left 23:30 finanalyst left 23:39 markmarkmark left, eof left 23:48 summerisle joined 23:53 gugod left, markmarkmark joined