🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). 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 6 September 2022.
00:00 reportable6 left, bigdata left 00:01 bigdata joined, reportable6 joined 00:06 bigdata left
avuserow what file does raku.land use for the main documentation source of a module? can it display documentation from other files in a module? 00:46
00:50 squashable6 left 00:51 squashable6 joined
avuserow looks like it might just be the README.md 00:59
I want to have some non-trivial documentation in another file but unsure whether I should use Pod6 or markdown, and how to output it so it can be actually viewed somewhere. 01:00
maybe pod6 in a separate file, then add a conversion step to .md into a docs directory, then you could use both rakudoc and view the generated .md file in github. 01:01
01:22 jpn left
Xliff Is this right? "multi sub infix:<d> ($a where * > 1, $b) is tighter( &infix:<*> ) { " -- I'm getting errors. 01:25
02:14 teatwo left 02:15 teatwo joined 03:15 reportable6 left, notable6 left, benchable6 left, unicodable6 left, committable6 left, linkable6 left, squashable6 left, quotable6 left, evalable6 left, bloatable6 left, nativecallable6 left, sourceable6 left, coverable6 left, releasable6 left, tellable6 left, shareable6 left, bisectable6 left, squashable6 joined, sourceable6 joined, bisectable6 joined, committable6 joined 03:16 reportable6 joined, evalable6 joined, bloatable6 joined, unicodable6 joined, tellable6 joined, coverable6 joined, notable6 joined 03:17 benchable6 joined, releasable6 joined, quotable6 joined, shareable6 joined, linkable6 joined 03:18 nativecallable6 joined 03:22 zara joined 03:23 zara left 03:39 rf left
Voldenet Xliff: Uh, it's 2, not *-2 (0 - Backtrace.new, 1 - current sub, 2 - parent sub) - it can sometimes show empty string for nameless sub, so consider `Backtrace.new.grep(*.subname)[2].subname` instead 03:56
tellable6 2023-05-05T14:55:40Z #raku <Xliff> Voldenet Is it always *-2 for Backtrace?
03:59 zara joined, zara left
Xliff Voldenet++: Thanks 04:05
m: sub c { Backtrace.new grep( *.subname )[2].subname),.say; sub b { c() }; sub a { b() }; a() 04:06
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> sub c { Backtrace.new⏏ grep( *.subname )[2].subname),.say; sub
expecting any of:
infix
infix stopper
statement end…
Xliff m: sub c { Backtrace.new grep( *.subname )[2].subname,.say }; sub b { c() }; sub a { b() }; a()
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> sub c { Backtrace.new⏏ grep( *.subname )[2].subname,.say }; su
expecting any of:
infix
infix stopper
statement end…
Xliff m: sub c { Backtrace.new.grep( *.subname )[2].subname,.say }; sub b { c() }; sub a { b() }; a()
camelia (Any)
Xliff m: sub c { Backtrace.new.[2].subname,.say }; sub b { c() }; sub a { b() }; a() 04:07
camelia (Any)
Xliff m: sub c { .say for Backtrace.new.map({ .subname // 'NO SUB NAME' } }; sub b { c() }; sub a { b() }; a()
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> .new.map({ .subname // 'NO SUB NAME' } ⏏}; sub b { c() }; sub a…
Xliff m: sub c { .say for Backtrace.new.map({ .subname // 'NO SUB NAME' } ) }; sub b { c() }; sub a { b() }; a()
camelia new
c
b
a
<unit>
Xliff Voldenet: Works a treat... thanks! 04:09
Why is Proc::Async telling me my Cro::HTTP::Server script is finished right after it starts listening? 04:21
Is it because react/whenever blocks are non-reentrant?
.... Ooor... because I refactored the event loop out of the service runner... 04:22
Hmmm...when will raku ever do the ‽ sigil? 04:31
It will happen...... one day! 04:32
avuserow Is it possible to make `new` a multi method, but avoid calling `Mu.new`? 04:42
m: class Foo {multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; say Foo.new(1, 2); say Foo.new(:a<1>, :b<2>) # this last one should fail 04:43
camelia Also okay
True
Foo.new
avuserow I guess I can declare `new` as a submethod. Then any subclasses would need to explicitly call `Foo.new`, which is maybe okay? 04:45
04:45 frost joined 05:45 unicodable6 left, reportable6 left, benchable6 left, sourceable6 left, coverable6 left, committable6 left, quotable6 left, nativecallable6 left, bloatable6 left, notable6 left, linkable6 left, evalable6 left, releasable6 left, bisectable6 left, tellable6 left, shareable6 left, statisfiable6 left, squashable6 left 05:46 nativecallable6 joined, statisfiable6 joined, shareable6 joined, coverable6 joined 05:47 notable6 joined, tellable6 joined, benchable6 joined, quotable6 joined, reportable6 joined, bloatable6 joined, committable6 joined, bisectable6 joined 05:48 squashable6 joined, unicodable6 joined, evalable6 joined, linkable6 joined, sourceable6 joined, releasable6 joined 06:00 reportable6 left 06:01 reportable6 joined 06:28 jpn joined 07:28 bisectable6 left, greppable6 left, linkable6 left, squashable6 left, reportable6 left, coverable6 left, releasable6 left, committable6 left, tellable6 left, unicodable6 left, notable6 left, benchable6 left, bloatable6 left, evalable6 left, nativecallable6 left, statisfiable6 left, sourceable6 left, shareable6 left, quotable6 left, nativecallable6 joined, evalable6 joined 07:29 notable6 joined, reportable6 joined, tellable6 joined, bloatable6 joined, committable6 joined 07:30 greppable6 joined, linkable6 joined, shareable6 joined, unicodable6 joined, quotable6 joined, benchable6 joined 07:31 statisfiable6 joined, releasable6 joined, coverable6 joined, bisectable6 joined, sourceable6 joined, squashable6 joined 07:50 TypoToni left 08:24 sena_kun joined
Xliff avuserow: You have to proto new in the class, like so: 08:25
m: class Foo { proto method new (|) { (* }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; say Foo.new(1, 2); say Foo.new(:a<1>, :b<2>) # this last one should fai
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> class Foo { proto method new (|) { (* ⏏}; multi metho…
Xliff m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; say Foo.new(1, 2); say Foo.new(:a<1>, :b<2>) # this last one should fai 08:26
camelia Also okay
Cannot resolve caller new(Foo:U: :a(IntStr), :b(IntStr)); none of these signatures matches:
(Foo: $a, *%_)
(Foo: $a, $b, *%_)
in block <unit> at <tmp> line 1

True
Xliff avuserow ^^
m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; say Foo.new(1, 2); say TRY Foo.new(:a<1>, :b<2>) # this last one should fai
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared name:
TRY used at line 1
Xliff m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; say Foo.new(1, 2); say try Foo.new(:a<1>, :b<2>) # this last one should fai
camelia Also okay
True
Nil
Xliff m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; Foo.new(1, 2); try Foo.new(:a<1>, :b<2>) # this last one should fai 08:27
camelia Also okay
Xliff m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; Foo.new(1, 2); { CATCH { default { say "Failure caught!" }; }; Foo.new(:a<1>, :b<2>) # this last one should fail } 08:28
camelia ===SORRY!=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 31>, :b<2>) # this last one should fail }⏏<EOL>
expecting any of:
statement end
statement modifier
statement modifier lo…
Xliff m: class Foo { proto method new (|) { * }; multi method new($a) {say "okay"}; multi method new($a, $b) {say "Also okay";}}; Foo.new(1, 2); { CATCH { default { say "Failure caught!" }; }; Foo.new(:a<1>, :b<2>) } # this last one should fail 08:29
camelia Also okay
Failure caught!
Xliff avuserow ^^
08:30 Xliff left 08:41 frost left 08:44 Sgeo left 08:54 lonewolf-dev joined
lonewolf-dev should i skip learning perl and use raku with per5 modules? 08:54
08:57 jpn left 09:02 MoC joined 09:03 MoC left
lizmat lonewolf-dev: ask that question here, and you'll get a: Yes 09:05
lonewolf-dev @lizmat i'm not going to mis out on anything by learning raku over perl? 09:06
and using perl5 modules from cpan?
in raku with inline::perl 09:07
is raku superior to perl?
I'm learning perl but i'm starting to doubt my decision since it looks like raku has all the features of perl + much more. 09:08
Nemokosch I'd say depends on what your priorities are. I had a similar reasoning roughly two years ago - I for one knew that basically all I'm gonna do "seriously" is shell-like scripting so I don't need many modules and performance is barely a concern 09:10
maybe there are more literal one-liners for text processing in Perl but frankly, once you reach two lines/statements, oldschool Perl is barely better than those nasty POSIX Shell dialects while Raku is a real programming language 09:12
lonewolf-dev Is raku the only language that can leverage modules from other languages like python/ruby/perl? 09:17
lizmat good question 09:18
Nemokosch do not read too much into that, though
lizmat using python in raku still has a number of raw edges, afaik 09:19
lonewolf-dev how smooth is using inline::perl? 09:20
raku should be perl6 right?
lizmat Inline::Perl5 allows you to use / subclass any module on CPAN that isn't using source-filters
which is 99.9%
lonewolf-dev so using perl5 modules should be easy right? 09:21
09:21 discord-raku-bot left, discord-raku-bot joined
lizmat yes, install Inline::Perl5 and DBI from CPAN 09:22
and you'd do: "use DBI:from<Perl5>"
and you'd be set
lonewolf-dev So as a complete beginner to perl. i should learn raku instead? 09:23
I was looking for a language for my personal linux system admin and to replace bash shell scripting.
Nemokosch please do that, you really can't make a wrong choice, use anything over Shell 09:24
lonewolf-dev And maybe a larger project in the future involving web scraping with www::mechanise from cpan
But i got confused with the hole perl6 vs perl5 fiasco.
Nemokosch to be honest, I would like to see more good references for using Inline::Perl. I haven't used it myself but what I saw on Reddit wasn't convincing at all. 09:25
For perl5 and perl6, I suppose everybody has a version of the story, even people who weren't around, like myself 09:31
lizmat to me, just mentioning Perl 6 is akin to deadnaming 09:33
Nemokosch much to my horror, there are people who still condemn the move to Python3 from Python2 09:34
There is not much overstatement in saying that the current Perl community was conditioned to have that crippling obsession for backwards compatibility, even for admittedly horrible code 09:35
lonewolf-dev so i'm not going to miss out on anything by learning raku over perl? 09:39
Nemokosch the only thing where Perl beats Raku - not to overlook that - is sheer performance. Yes yes, in before, there might be situations where Raku is faster and simple parallelism and all but yes, on fat average, Perl is considerably faster to this day. 09:41
A couple of months ago I met a friend from back in the university days and he talked about some bulky, 10k lines legacy tool they were using for something. He said it was a "Pascal script". Then the conversation went on and I mentioned Perl for some reason and then he said "oh, maybe that script was written in Perl actually 🤔 " 09:43
so yeah, for the "new folks", it's just "some really old language, what was its name again" - and as someone who loves Free Pascal at least, it kind of hurts me to think of it like that 😅 09:45
lonewolf-dev shoulnd raku be faster than perl because its a vm based language? 10:03
Nemokosch I don't know if it "should" but most of the time it isn't 10:11
lizmat some workloads can be faster than Perl atm 10:12
but using regular expressions in Raku will make things slower
that's because regular expressions in Raku aren't implemented as a state machine (like it is in Perl) 10:13
but as code, giving you *much* more flexibility and options, but at a price
10:16 n1to joined 10:19 not-n1to joined 10:22 n1to left
lonewolf-dev when to use raku when to use perl? 10:22
lizmat there's only one answer to that: yes 10:27
sorry, but that's the kind of question that needs more information to be able to answer genuinely 10:31
10:36 ab5tract left 10:45 lonewolf-dev left 10:51 japhb left, japhb joined 11:24 zara joined 11:25 jpn joined 11:38 zara left 11:48 jpn left 11:54 jpn joined 12:00 reportable6 left, jpn left 12:02 reportable6 joined
tbrowder__ tonyo: did i see correctly your recent update to fez can delete a module from the active archive? 12:26
lizmat only if it was uploaded <24 hours ago, afaik 12:27
tbrowder__ ah, ok. it would be nice to somehow remove old, bad ones and put them away from easy access 12:29
lizmat but who's to judge what is old and bad? 12:50
ugexe i imagine one day we'll be able to implement something like that, but it'd be based on heuristics (i.e. how many non-ci system/ip downloaded it for instance) as well as some sort of consensus algorithm / system for manual overrides that don't have to involve the site owner 12:55
Voldenet >Perl beats Raku - not to overlook that - is sheer performance
Perl5 is relatively fast compared to a lot of languages 12:56
13:02 linkable6 left, evalable6 left, evalable6 joined 13:03 jpn joined 13:04 linkable6 joined 13:12 jpn left 13:50 rf joined 14:16 teatime joined 14:18 teatwo left 15:07 TypoToni joined
Nemokosch just imagine if it even was a well-designed language in addition... 15:43
not just a half-grown-up shell
15:46 heartburn left
lucs Problem 'augment'ing Match class, with more details: gist.github.com/lucs/0d659fe98c9b7...6f005b0996 15:52
15:53 heartburn joined
lucs vrurg: I'm not sure I understand the reasons for your reluctance to using 'augment'. 15:58
Can you elaborate or point me to some already written stuff on this?
16:05 Petr joined
Petr Hello. Can I install Raku on Haiku os ? 16:06
tellable6 2021-10-11T19:56:00Z #raku <melezhik> .tell Petr: Hi! Good to see you here. I am Russian as well
2021-10-11T20:55:00Z #raku <japhb> Petr: You could always use it via Inline::Perl5 ...
Petr I can't find Daly for Haiku 16:08
Raku 16:09
lizmat if it haz a C compiler, you probably could? 16:11
16:18 Petr left 16:20 MoC joined, MoC left 16:26 jpn joined 16:30 jpn left 17:17 TypoToni left 17:22 perryprog left, perryprog joined, Scotteh left 17:26 jpn joined 17:31 Scotteh joined 17:44 jpn left 18:00 reportable6 left
librasteve sorry 18:01
18:01 reportable6 joined 18:15 Sgeo joined 18:28 Vyrus left, Vyrus joined 19:28 sourceable6 left, quotable6 left, squashable6 left, greppable6 left, coverable6 left, tellable6 left, evalable6 left, notable6 left, nativecallable6 left, committable6 left, bloatable6 left, bisectable6 left, shareable6 left, benchable6 left, statisfiable6 left, reportable6 left, linkable6 left, releasable6 left, unicodable6 left 19:29 nativecallable6 joined, sourceable6 joined, bloatable6 joined, committable6 joined, benchable6 joined, statisfiable6 joined, releasable6 joined, evalable6 joined 19:30 squashable6 joined, coverable6 joined, linkable6 joined, reportable6 joined, tellable6 joined, bisectable6 joined, shareable6 joined 19:31 unicodable6 joined, quotable6 joined, greppable6 joined, notable6 joined 20:06 n1to__ joined, not-n1to left 21:06 linkable6 left, nativecallable6 left, unicodable6 left, coverable6 left, reportable6 left, quotable6 left, releasable6 left, committable6 left, statisfiable6 left, evalable6 left 21:08 statisfiable6 joined, reportable6 joined, unicodable6 joined, quotable6 joined, nativecallable6 joined, evalable6 joined 21:09 committable6 joined, releasable6 joined, coverable6 joined, linkable6 joined 21:13 jpn joined 21:18 jpn left 21:42 sena_kun left 21:54 jpn joined
gfldex m: Match.HOW.say; 22:34
camelia Perl6::Metamodel::ClassHOW.new
gfldex m: Match.^mro.say; 22:36
camelia ((Match) (Capture) (Cool) (Any) (Mu))
22:54 evalable6 left, linkable6 left 22:55 evalable6 joined 22:57 linkable6 joined 23:04 jpn left 23:07 euandreh left, perlmaros joined, mst joined, a3r0 joined, elcaro joined, tib_ joined, donpdonp|z_ joined, kjp joined 23:08 thowe joined, dustinm` joined 23:09 justache joined, justache left, xelxebar joined, gordonfish joined, lizmat joined, euandreh joined, cm joined 23:12 Woodi joined, _________ joined 23:13 bdju joined, justache joined 23:19 jmcgnh joined
gfldex lucs: Please try `Match.HOW.compose(Match);` after augmenting Match. 23:20