🦋 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.
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
theangryepicbanana it looks like they're using `andthen` in place of `==>` or some sort of smalltalk-like cascade operator 02:51
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
Voldenet hm, it's somewhat weird to read 03:01
theangryepicbanana it is, I wish I could use .? instead like in other languages 03:24
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
rrmm m: say 5; 08:10
camelia 5
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
Nemokosch not like it's a huge deal to write dd in front of a line... 08:29
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)
Nemokosch 👍 09:34
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
infix stopper
Nemokosch it thinks that Z is a meta-operator here 09:59
same with X
[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
[Coke] Thanks! 11:46
sienet_ja_LSD[m] aye
[Coke] Now to also fix my network issues so the router doesn't keep disconnecting. :)
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?
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
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
patrickb There we go: # Increase nofile soft from the default of 1024. 15:59
Argh! 16:00
stackoverflow.com/questions/726057...open-files
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
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
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
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
[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
oops
spoiled it
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
[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
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
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
lizmat PSA: the Rakudo Weekly News will be published tomorrow 20:36
Nemokosch what does PSA mean? 20:52
lizmat Public Service Announcemenr
*t
Nemokosch oh 😄 20:54
Anton Antonov @lizmat Thank you for your efforts! 22:00
Nemokosch why does this 22:38
m: dd [+] $(1, 2, 5, 7) 22:38
work as expected (summing the elements) 22:40
but
m: dd [\+] $(1, 2, 5, 7)
not?
for better record:
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:
prefix
statement list
term
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
Nemokosch github.com/rakudo/rakudo/issues/4955 22:55
and now I managed to cause segfault xD 22:56