This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html
Set by lizmat on 8 June 2022.
01:03 MasterDuke left 02:49 saint- left 08:34 lizmat left
gfldex @rcmlz please note that my code required corrections, see: gist.github.com/gfldex/7d76fa95f62...140da65699 08:53
`start` is so slow that the decrement happend to late 08:54
rcmlz I was not monitoring that - it improved the speed significantly. Thanks for pointing that out! Benchmarking by sorting 40960 strings of size 8 - using batches of 1024 strings and 4 workers. [quicksort => 5.600979287 quicksort-parallel => 0.540380128] 09:00
12:24 Manifest0 joined
codesections gfldex: Yeah, I've run into that "start being slow to start" issue before. I asked about it on StackOverflow, and jnthn recomended `.keep`ing a Promise from inside the `start` block: stackoverflow.com/a/69369210 15:24
librasteve jerome7059: suggest you take a look at Dan::Pandas - something like df.pd: '.read_parquet("test.parquet")'; will probably work 17:51
otherwise, please raise an issue over there and I can take a look... 17:52
17:56 lizmat joined 17:58 p6steve joined
antononcube @librasteve Damn, it did not occur to me to see/refer to "Dan::Pandas". 17:59
librasteve I am scotty to your kirk 18:01
18:06 p6steve left 18:20 p6steve joined 18:29 p6steve left 19:28 p6steve joined 19:32 p6steve left
pelevesque Is it normal that Raku gives me the Usage message if I pass a file that does not exist? perl raku parse_arguments.raku --file noexist.txt Usage: parse_arguments.raku [--file=<FilePath>] [--number=<Num>] [--flag] --file=<FilePath> A file to do stuff with [default: 'hello.txt'] --number=<Num> A number for some reason [default: 8500] --flag 19:52
nemokosch if your interface specifies a check for it then yes 19:53
pelevesque subset FilePath of Str:D where *.IO.f; sub MAIN( FilePath :$file = "hello.txt", #= A file to do stuff with Num :$number = Num(8.5E3), #= A number for some reason Bool :$flag = False #= A switch to do something )
nemokosch then yes it is
pelevesque That was the code
nemokosch the sub candidate failed, the fallback is the usage message
pelevesque Hey, I have a friend who is staring Raku. It says invites are dissabled here. How can I get him to join? 19:55
nemokosch there is a public invite 19:56
pelevesque hmmm where
nemokosch discord.com/channels/5384078799804...9465954334
pelevesque cdn.discordapp.com/attachments/768...3992f& 19:57
nemokosch there is the invite 20:00
and it definitely works, I just "scammed" someone into joining
pelevesque Is it the link at the top of that #info-and-rules page you linked to? 20:02
nemokosch yes 🤔 20:03
philippecarphin Found it online, I'm in 20:04
nemokosch what troubles one has to suffer to get an invite 🤣 20:05
20:05 p6steve joined 20:06 p6steve left
pelevesque Cool! Hi Phil. That is the one I was trying to let in Nemokosch 20:07
Phil, Nemokosch is a kind of Raku wizard. He knows a lot. Nemokosch, Phil is a reallly good Python, C, C++ programmer who likes Go and Rust too.
philippecarphin I'm the one that had the question about the argument parsing with the FilePath. I was wondering if there was a way to keep the types of MAIN's arguments as they are: perl subset FilePath of Str:D where *.IO.f; sub MAIN( FilePath :$file = "hello.txt", #= A file to do stuff with ) but do something so that a message gets printed if the file doesn't exist. I reverted to doing sub MAIN( Str 20:08
:$file = "hello.txt", #= A file to do stuff with ) { if ! $file.IO.f { say "ERROR: The file '$file' does not exist"; exit 1; } }
nemokosch hm 20:13
to be honest, I often reverted to smartmatching to the subset, kind of a middle ground
I think there is a &*MAIN-USAGE (or some similarly named) hook
it was GENERATE-USAGE, actually 20:14
docs.raku.org/language/create-cli there is plenty of stuff here, to be honest, I never delved deep into this 20:16
the banal solution would be to make MAIN a multi and dispatch failures separately
scullucs @philippecarphin Kaka fa la-la! 20:17
philippecarphin Ok cool thanks I'll look into that.
scullucs @philippecarphin Happy to see you trying out Raku. 20:18
nemokosch Team France? 20:19
pelevesque Team Montréal
scullucs We're in Montreal, QC.
philippecarphin Oui oui, Montreal 20:21
nemokosch well technically I'm a CAE employee or something
so Montreal is like, almost close
librasteve subset FilePath of Str:D where *.IO.f; multi sub MAIN( FilePath :$file = "hello.txt", #= A file to do stuff with ) { say $file } multi sub MAIN( Str:D :$file ) is hidden-from-USAGE { say "ERROR: The file '$file' does not exist"; } 20:34
^^ i think that this is what you are after ?
philippecarphin That's exactly what I was looking for! Thank you very much. 21:07
21:13 deoac joined