🦋 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.
thundergnat Altreus: Sorry to ghost you earlier, I was at work and IRC use is somewhat frowned on so I was kind-of hit and run. I've uploaded V0.1.0 of Base::Any that supports loading custom digit sets out of the box. 00:12
tellable6 2020-11-13T13:12:49Z #raku <Altreus> thundergnat: Any chance of something like to-base-alphabet('0123456789abcdefghjkmnp') ...
cpan-raku New module released to CPAN! Universal::errno (0.1.0) by 03GARLANDG 06:24
samebchase- Hi, I'm using a library in a script which appears to have a bug in version X. I did `zef install "<LIB-NAME>:<ver>:<PREV-VERSION>"`, but the bug is still showing up. How do I ensure, that after `zef install`, the correct library version is picked up. Currently, my workaround was to update the compiler version and then installed the previous version 07:11
of the library so that I start from a blank slate so to speak, and now the bug does not show up.
How do we clean up old library artifacts which might be precompiled and get picked up by the program even though I have installed a different version 07:12
gfldex samebchase-: you can select the version to be used with the use-statement 08:03
holyghost is back 08:40
samebchase- gfldex: thanks, I shall do that 👍 09:44
I'm assuming that when a version is not specified, it will pick up the latest version present? 09:45
lizmat well, it's slightly more complicated than that 09:46
you can also specify the :auth<> in a use statement and the :api< >
generally, it will take the best matching and fail if there are none, or there is more than one given the arguments 09:47
lizmat if you don't specify any at all, I think it will indeed take the highest version one 09:48
samebchase- thanks for the explanation lizmat. Raku is helping me at work. Written some tools in Raku which help while debugging oncall incidents. 10:14
gfldex samebchase-: Nice to hear that our masterplan for world domination is playing out nicely.
samebchase- I intend to do a short talk on Raku sometime so that others can try it out as well 10:18
gfldex I would not know how to have a *short* talk about Raku. :-> 10:20
samebchase- gfldex: 😅 10:43
tyil samebchase-: if you feel like it, you could write an advent calendar post on some cool things you've done with Raku too 10:53
frost-lab hello, everyone 12:30
lizmat frost-lab o/
frost-lab I want to run a command like "ls -l > 1".
How can I do that in Raku
use the 'run' function 12:31
lizmat raku -e 'run <ls -l>' >1 ??
or do you want the >1 also in raku ? 12:32
frost-lab Yes, I want use pipe to write output to file 12:33
leont my $out = open :w, '1'; run <ls -l>, :$out;
lizmat raku -e 'run <ls -l>, :out(open("1",:w))'
frost-lab Thanks! 12:34
samebchase- tyil: I'll try! I _may_ have something worth sharing which has something to do with Grammars. Let's see if I can finish it 13:01
tyil that would be awesome!
gfldex frost-lab: If you don't mind modules there is a short cut. use Shell::Piping; px<ls -1> |>> '1.txt'.IO; 13:41
cpan-raku New module released to CPAN! Physics::Unit (1.0.0) by 03PSIXSTEVE 14:03
moritz while cleaning out old stuff we just found a big card with congratulations from lots of Perl and Raku (then Perl 6) folks 14:14
the occasion was our wedding roughly 10 years ago
I had forgotten about the card, it brought up fond memories 14:15
sjn that's nice :)
how's life treating you, btw?
moritz the signatures I can read are from lizmat, wendy, sorear, TimToady, jnthn, Peter Rabbit Rabbitson, theorbtwo, Markov, szabgab, Schwern (page 1) 14:17
Dave S, Tom, Ilmari, mugwump, Meli, Dean Swift, Martin Berends, Marc, Chisel, Nick and the London Perl Mongers 14:18
moritz sjn: as good as can be during a pandemic, I'd say. Lots of small annoyances like broken appliances and such this year, but we're healthy, I have we well-paying and secure job that allows 100% remote work, and we're all healthy 14:19
sjn nice :) 14:20
moritz kids are thriving, and my baking and cooking skills are improving :-)
sjn: how about yourself?
sjn moritz: I'm doing ok. Working for a startup now (Mojo/etc) that's doing pretty well. Pandemic is much less horrible here than in most of Europe, and I'm managing to keep myself busy :) 14:22
moritz sjn: sounds good 14:30
we had planned for our younger daughter to attend the 17. May celebrations in Oslo this year, but that didn't work, of course 14:31
the real bummer is that starting from September this year she is in school, and that's not during any Germany holidays, so getting her there in future will be much harder/more hassle
sjn moritz: oh well :-| 14:47
moritz: if you somehow find a way here anyway, feel free to get in touch! :) 14:48
moritz sure, willdo
Geth ¦ problem-solving: lizmat assigned to codesections Issue How should modules/distributions be handled when severe security issues are discovered? github.com/Raku/problem-solving/issues/245 16:08
ben_ Can anyone think of a way to create a recursive class using `anon`? For example `class type { has type $!inner }` compiles but `my $type = anon class { has $type $!inner }` does not. 16:25
tobs ben_: you can refer to the class being currently defined through ::?CLASS 16:31
m: my $type = anon class { has ::?CLASS $.inner }; say $type; say $type.new.inner.WHAT 16:32
camelia (<anon|1>)
(<anon|1>)
ben_ Awesome! Thanks 16:38
UukGoblin hello everyone. Is it just me, or does syntax hilighting gets screwed up starting from Section "1.3 Hashes, or key-value Pairs." at learnxinyminutes.com/docs/raku/ ? 17:29
jmerelo UukGoblin: looks like the absence of a blank line after a comment wreaks havoc there. 18:07
ben_ Are there any JS or wasm linters that have support for raku? 18:08
jmerelo ben_: well, we use one for the docs. It's not perfect, but it works pretty well. It's based on the Atom mode for Raku. 18:12
ben_ In the docs repo? github.com/Raku/doc 18:17
cpan-raku New module released to CPAN! Auth::SCRAM (0.4.8.2) by 03MARTIMM 18:19
jmerelo ben_: right. 18:27
ToddAndMargo Hi All. I am having trouble finding the command to create a new blank file. 19:36
moritz touch yourfile 19:37
ToddAndMargo `touch` is system command. I am not finding it in the raku docs. I suppose I could `qqx ( touch yourfile )`. I would like to be able to do it from Raku. 19:39
thundergnat "yourfile".IO.open(:w) 19:45
thundergnat That will overwrite an existing file though 19:46
"yourfile".IO.open(:a) # will create if it doesn't exist, but not wipe out an existing file 19:47
ToddAndMargo Works for me. That way I do not have to do an unlink. Thank you! 19:48
Grinnz metacpan.org/release/Path-Tiny/sou...L2008-2024 is how to approximate touch in perl, so from raku would be a similar process (utime is a function that sets modification time)
ToddAndMargo :-) 19:50
lizmat wonder if it would make sense to allow spurt to have "" for a default content of file, to easily allow creation of an empty file 20:10
ToddAndMargo what is the syntax to run and release a program? `start` does ot error out, but he program does not start. 20:33
ot = not
ben_ Are you looking for `run` or `shell` maybe? 20:35
ToddAndMargo I don't care which, just the result that the program I run gets released and my program continues on its way 20:39
I like run, but it waits for a return.
Zero_Dogg Proc::Async maybe? 20:42
ToddAndMargo how would I use that?
Zero_Dogg docs.raku.org/type/Proc::Async 20:43
lizmat rdocs.raku.org/type/Proc#method_spawn perhaps ?
ToddAndMargo that seems to be for writing to files, not running programs. Am I missing something? 20:45
Zero_Dogg Both Proc.spawn and Proc::Async are for running subprocesses 20:47
ToddAndMargo would you mind writing me an example of spawn? 20:50
Zero_Dogg Proc::Async lets you run them in a non-blocking way
I'm not sure what lizmat referred to with Spawn to be honest. If you're looking to run a command synchronously you're probably looking for 'run', to run something asynchroniously Proc::Async 20:55
m: run "pwd" 20:56
camelia /home/camelia
Zero_Dogg whereas with Proc::Async: 20:58
m: my $pA = Proc::Async.new("pwd"); my $promise = $pA.start; await $promise
camelia /home/camelia
Zero_Dogg You can drop await-ing the promise to just go about your business 20:59
ToddAndMargo p6 'my $pA = Proc::Async.new( "/usr/bin/leafpad" ); my $promise = $pA.start;'JOy! 21:06
Altreus thundergnat: sweet! Didn't feel ghosted - that's IRC 21:41
I'mma check it out
Altreus at least I got to practice my raku 21:42
Hermitude is there any effort underway to making raku into the kind of scripting language runtime that can be embedded in a c/c++ program? 22:54
For example, as an extension mechanism for said program?
sjn Hermitude: out of curiosity; why would you want to do something like that? (serious question - I've seen plenty of people ask for this, and actually use this, but I've always thought there was something backwards about this) 23:02
I have to admit I probably am just unaware of any situations where this is the best pattern... 23:04
leont Question is really "what do you want to achieve?" 23:13
cpan-raku New module released to CPAN! Getopt::Long (0.2.0) by 03LEONT 23:19
Hermitude I'd like to build a desktop app with plugin/extension capability offered via raku
i LOVE the language but unfortunately it doesn't seem to offer a direct means of embedding rakudo and moarvm 23:20
MasterDuke i can be done, look at Inline::Perl6
*it can 23:21
Tirifto leont: Thanks! :)
leont Tirifto: for Getopt::Long? :-) 23:22
MasterDuke metacpan.org/pod/Inline::Perl6
leont has a lot of things to say about this, but ENEEDTOSLEEP
Hermitude i will take a look 23:23
I think I've heard of it before and it seems to be a one-off rather than a well-trodden path
Tirifto leont: Yeah! I just made use of it yesterday. (And today, technically.)
leont has been planning to write a "why everyone should be using Getopt::Long" article, but haven't gotten around to it 23:24
Tirifto I guess you should sleep first, but I’ll be looking forward to it! 23:25
MasterDuke i suspect that's a reasonably fair assessment. it's probably a bit late now, but if you have questions nine (who wrote it and Inline::Perl5) is usually around during the day
leont The hard part of embedding is not calling functions from A to B, but dealing with data 23:26
Hermitude Also since it's calling rakudo with no binary modifications it is likely spawning a child process
MasterDuke pretty sure it's using libmoar.so
leont Yeah, it's a bit esoteric still, but entirely possible 23:27
Hermitude Sure, you have to offer conversions and wrapping -- but this is the purpose of engineering native support directly into the project
Man I would really get a lot of use out of an embeddable Raku interpreter
MasterDuke but my knowledge is all second-hand at best, nine can actually answer any questions 23:28
Hermitude Right now Python is the default go-to extension mechanism and tbh it just sucks -- no native multithreading is too big a strike
leont at some point completely programmed themselves into a corner writing a libperl++, he's not wondering what a libraku++ would look like
Hermitude there's also Lua but I don't like it either 23:30
leont Lua is optimized well for embeddability, but it's not the greatest of languages 23:31
It's great for what it is designed to do, but not so great otherwise, IMHO