🦋 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 inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
00:06 reportable6 left 00:07 reportable6 joined 01:06 qorg11 left 01:09 qorg11 joined 01:20 frost joined 01:38 [Coke] left 01:41 [Coke] joined 02:11 Guest35 left 03:11 linkable6 left, unicodable6 left, committable6 left, statisfiable6 left, bisectable6 left, evalable6 left, coverable6 left, quotable6 left, shareable6 left, reportable6 left, notable6 left, tellable6 left, benchable6 left, bloatable6 left, greppable6 left, sourceable6 left, releasable6 left, nativecallable6 left, bloatable6 joined 03:12 statisfiable6 joined, releasable6 joined, nativecallable6 joined, benchable6 joined, greppable6 joined, linkable6 joined, sourceable6 joined, bisectable6 joined, notable6 joined, reportable6 joined 03:13 quotable6 joined, committable6 joined, shareable6 joined 03:14 unicodable6 joined, evalable6 joined, coverable6 joined, tellable6 joined 03:36 Sankalp left, Sankalp joined 04:06 ProperNoun joined, z4kz83 joined 04:07 z4kz83 left, ProperN[out] left 05:04 jcallen left, leont left, skaji left, ugexe left, eof left, skaji joined, jcallen joined, summerisle joined, leont joined, ugexe joined 05:11 tellable6 left, coverable6 left, shareable6 left, notable6 left, sourceable6 left, bisectable6 left, linkable6 left, benchable6 left, statisfiable6 left, bloatable6 left, dg left, simcop2387 left, jrjsmrtn_ left, vrurg left, gabiruh left, dg joined, gabiruh joined, simcop2387 joined 05:12 vrurg joined 05:13 jrjsmrtn joined 05:15 statisfiable6 joined, sourceable6 joined, linkable6 joined, bloatable6 joined, benchable6 joined, coverable6 joined, notable6 joined, bisectable6 joined, tellable6 joined, shareable6 joined 06:06 reportable6 left, reportable6 joined 06:43 mexen joined 06:44 jjido joined 07:04 Sgeo left 07:05 abraxxa joined 07:09 abraxxa left 07:10 abraxxa joined 07:49 dakkar joined 08:04 TempIRCLogger left 08:06 TempIRCLogger joined 08:36 jjido left 08:43 lichtkind joined 08:44 jjido joined 09:15 lichtkind_ joined 09:18 lichtkind left
Nemokosch gist.github.com/2colours/795bc0608...ef1ac43bf5 09:59
what happened here?
works when `andthen` starts on the same line 10:00
reminds me of ASI in Javascript... 10:01
CIAvash Nemokosch: docs.raku.org/language/syntax#Impl...in_blocks) 10:10
tellable6 CIAvash, I'll pass your message to Nemokosch
Nemokosch oh crap, this is really ASI 😬 10:14
Voldenet ASI is not that bad, enforces specific formatting discipline 10:15
10:18 evalable6 left, linkable6 left 10:19 linkable6 joined, evalable6 joined
Nemokosch wouldn't use the word "discipline" here 10:21
it's rather just a certain style, a not necessarily good one
Voldenet Sure, good and bad are relative to moral standpoint after all ( ゚‿ ゚) 10:23
Nemokosch I mean, discipline implies a certain carefulness, as if it were superior and not just a certain choice you are stuck with for technical reasons 10:25
and for colon method calls, this feels like the final nail in the coffin
Voldenet Just my opinion, but I find colon method calls messy 10:28
Nemokosch this `andthen` was already a bit hackish attempt to make use of them but hell, not at the cost of adding much more line noise than just using parens
CIAvash You have some options, but you may not like them 10:29
<1 3 5>.map: {
} andthen .say;
<1 3 5>
==> map({$_**$_})
==> say();
Nemokosch I never managed to understand this long arrow to be honest 10:30
Voldenet long arrow is actually quite cool syntax
CIAvash "feed operator"
10:32 Altai-man joined
Nemokosch Sometimes it did seem clean and concise but I just didn't grasp how it works 10:32
Voldenet m: sub accept-long-arrow(&code, $x) { $x.&code }; ^10 ==> accept-long-arrow { .map(* * 2) } ==> say() 10:33
camelia (0 2 4 6 8 10 12 14 16 18)
Voldenet sequencer operators precedence is low, which is pretty nice 10:35
Nemokosch what is this $x &code black magic xD 10:38
CIAvash docs.raku.org/language/operators#i...dop_.& 10:39
Nemokosch this one I know 10:40
lizmat m: sub double($text) { say $text x 2 }; "foobar".&double 10:48
camelia foobarfoobar
Voldenet in fact, feed operator lets you skip a lot of () and {} 10:51
m: sub accept-long-arrow(&code, $x) { code($x) }; ^10 ==> accept-long-arrow *.map: * * 2 ==> accept-long-arrow *.say
camelia (0 2 4 6 8 10 12 14 16 18)
Nemokosch why does this work? 10:52
Voldenet basically, WhateverCode can be invoked 10:53
m: (* * 2)(2).say
camelia 4
Voldenet non-fancy way of writing this would be: 10:55
m: sub accept-long-arrow(&code, $x) { code($x) }; ^10 ==> accept-long-arrow({.map({ $_ * 2 }) }) ==> accept-long-arrow({.say})
camelia (0 2 4 6 8 10 12 14 16 18)
Voldenet and feed operator just passes everything on the left as last parameter of the given function 10:58
Nemokosch > and feed operator just passes everything on the left as last parameter of the given function 11:07
hmmm 😮
Voldenet (ofc, the code above is pointlessly verbose, you could write this in a lot shorter way)
m: ^10 ==> map * * 2 ==> say() 11:08
camelia (0 2 4 6 8 10 12 14 16 18)
11:10 jjido left 11:24 wingfold joined 11:36 jjido joined 12:07 reportable6 left 12:08 reportable6 joined 12:22 jjido left 12:47 jjido joined
[Coke] tmux a 13:12
Voldenet sessions should be nested with care, unset $TMUX to force
[Coke] thtop
13:21 Altai-man left 13:22 Altai-man joined 13:30 [Coke] left 13:33 jjido left 13:36 [Coke] joined 13:48 Sgeo joined 14:16 discord-raku-bot left 14:17 discord-raku-bot joined 14:47 Kaipei left 15:01 Kaipei joined 15:13 frost left
Nemokosch > ^10 ==> map * * 2 ==> say() 15:46
exactly the kind of stuff that makes me so confused
15:47 abraxxa left 16:17 Guest35 joined
is this arrow really just a way to invert the call chain? 16:34
what I mean is that it doesn't seem to do anything special with a list, it doesn't iterate over it or anything
Voldenet nope 16:37
16:40 dakkar left
Voldenet …well it also has this funky behavior 16:42
Nemokosch 👀 16:43
Voldenet m: my $foo = class { method append(|x) { say x }; }.new; ^10 ==> $foo ==> say()
camelia \((0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
(0 1 2 3 4 5 6 7 8 9)
Voldenet Why? Absolutely no idea
[Coke] Which part of that exactly is funky? 16:50
Nemokosch is there a straightforward way to call methods rather than bare functions? 16:51
[Coke] m: ^10 ==> map({ .say }) 16:52
camelia 0
[Coke] docs.raku.org/routine/==%3E 16:53
16:53 discord-raku-bot left, discord-raku-bot joined 16:58 Kaipei left 16:59 Kaipei joined
Nemokosch map is a bare function in this example, no? 17:01
17:03 morte_ joined 17:06 mexen left 17:09 Altai-man left
Voldenet [Coke]: the part where .append can be called, it's… weird 17:18
m: ^10 ==> 42
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.push' may appear on either side of feed operators.
at <tmp>:1
------> ^10 ==> ⏏542
Voldenet m: ^10 ==> class { method push(|x) { say x }; }.new
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.push' may appear on either side of feed operators.
at <tmp>:1
------> ==> class { method push(|x) { say x }; }⏏.new
17:23 [Coke] left, [Coke]_ joined
[Coke]_ I assume the append is called because that's how you add a bunch of data to the end of an array, and you've given it something that isn't callable in the pipeline 17:24
m: my @a; ^10 ==> @a; say @a.elems
camelia 10
[Coke]_ and the "42" earlier doesn't let you invoke it *or* save data in it.
17:24 [Coke]_ is now known as [Coke]
[Coke] nemokosch, yes map is a bare function. no you can't call methods in a chain directly. if you want to use methods.. use them directly. 17:25
Voldenet m: ^10 ==> class { method append(|x) { say x }; }.new 17:26
camelia ===SORRY!=== Error while compiling <tmp>
Only routine calls or variables that can '.push' may appear on either side of feed operators.
at <tmp>:1
------> > class { method append(|x) { say x }; }⏏.new
Voldenet my $foo = class { method push(|x) { say x }; }.new; my @a; ^10 ==> $foo
m: my $foo = class { method push(|x) { say x }; }.new; my @a; ^10 ==> $foo
camelia Cannot resolve caller append(<anon|1>:D: List:D); none of these signatures matches:
(Any:U \SELF: |values)
in block <unit> at <tmp> line 1
Voldenet m: my $foo = class { method append(|x) { say x }; }.new; my @a; ^10 ==> $foo
camelia \((0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
[Coke] the SORRY is at compile time there. 17:28
you're trying to pass something that has to be figured out at runtime, I think.
Voldenet Yes, but .push is not actually needed or used 17:29
[Coke] Assuming that's a change that was made in the implementation and not in the error message. 17:31
(append lets you append a bunch, push is one at a time) 17:32
Looks like it's hardcoded to *use* append, so even if you define a push, it doesn't fall back to it. 17:33
seems bug worthy.
Nemokosch [\,] $seq andthen .toggle: !*.repeated andthen .last 17:34
looks good enough I think
by the way
I've shown this ASI-looking example gist.github.com/2colours/795bc0608...ef1ac43bf5
Voldenet it's a minor bug either way, it was meant to be used with arrays I suppose
Nemokosch it is indeed mentioned ("implied separator rule") 17:36
but what is the rationale behind?
`*.grep: {}` is a method call syntactically, it doesn't contain the block on the top level
17:48 morte_ left 18:07 reportable6 left 18:09 reportable6 joined 18:22 sena_kun left 18:28 sena_kun joined 18:33 sena_kun left, morte_ joined, Kaipei is now known as Kaiepi 18:34 sena_kun joined
CIAvash FWIW design docs say this: "If the operand on the sharp end of a feed is not a call to a variadic operation, it must be something else that can be interpreted as a list receiver, or a scalar expression that can be evaluated to produce an object that does the KitchenSink role, such as an IO object. Such an object provides .clear and .push methods that will be called as appropriate to send data. (Note that an IO object used as a sink will force eager 18:35
evaluation on its pipeline, so the next statement is guaranteed not to run till the file is closed. In contrast, an Array object used as a sink turns into a lazy array.)" design.raku.org/S06.html#Feed_operators
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/05/09/2022-19-docublast/ 18:42
Nemokosch oh nice 19:00
so <( and )> basically manipulate $0? Am I following? 19:01
lizmat no, they limit the match 19:02
19:02 n1to joined
lizmat in that example, there is no $0 19:02
m: say "foobarbaz" ~~ / foo <( \w+ )> baz /; say $0
camelia 「bar」
Nemokosch hmmm 19:03
I guess I'm mixing it up with Python regexes... what _would_ $0 denote actually?
lizmat m: say "foobarbaz" ~~ / foo ( \w+ ) baz /; say $0 19:04
camelia 「foobarbaz」
0 => 「bar」
lizmat using positional captures creates more information, that you may not need
Nemokosch in my mind, it was the whole matching string 19:05
lizmat m: "foobarbaz" ~~ / foo ( \w+ ) baz /; say $/; say $0
camelia 「foobarbaz」
0 => 「bar」
lizmat also, you don't need to use both, you can use either
m: say "foobarbaz" ~~ / foo <( \w+ baz /
camelia 「barbaz」
lizmat m: say "foobarbaz" ~~ / foo \w+ )> baz / 19:06
camelia 「foobar」
lizmat it's like \K in Perl, but on steroids and both ways ?
Nemokosch I still tend to forget the regex; the interface is highly different compared to the Python module 19:09
seems like even $0, $1, $2 stuff is some kind of match object, not a raw string
lizmat indeed... $0 is just short for $/[0] 19:14
and $<foo> is just short for $/<foo>
a match creates a Match object, that may consist of more sub-Match objects 19:15
Nemokosch okay, I will eventually remember, thanks 😄 19:19
On a different note: overall it's pretty sad how the whole Perl community is divided deep down 19:20
lizmat I don't know, I don't consider myself part of the Perl community anymore 19:23
so I'm not keeping up-to-date on developments there
19:26 sena_kun left 19:27 sena_kun joined
Nemokosch I mean yes, probably the biggest split is between current Perl and well, what was thought to become current Perl... 19:28
19:31 morte_ left
lizmat I tried for the longest time to make that happen... alas, I gave up 19:31
Nemokosch Anyway, I just don't get the mourning attitude I come across on forums... indeed, it's not 2000 anymore but there isn't much point in wondering how we could pretend it were
lizmat in hindsight, I think I didn't give up early enough
Nemokosch oof 19:32
lizmat I hadn't realized that the active/vocal members of the Perl community had already driven away most of the more liberal people 19:33
so those who remained behind were hard-core anti what is now Raku
and those who remained behind, would blame all of the issues on what is now Raku 19:34
and now many of the issues that started the whole (what is now) Raku effort, still remain in Perl
and cannot be fixed without breaking compatibility 19:35
and that's basically the only thing that Perl has going for it in this day and age
El_Che lizmat: www.youtube.com/watch?v=L0MK7qz13bU
Nemokosch 🤣 19:36
lizmat yeah, got the hint.... I'll be afk and cool down &
El_Che lizmat: you because we care :)
Nemokosch I was barely alive in the late 90's early 2000's so it's not like I could give some proper analysis 19:37
lizmat before I go, some things to ponder from those days
Nemokosch but I think what happened was mostly a shift in emphasis 19:38
perhaps people accepted that shell would suck, no matter what xD
lizmat in the early 2000's I was working on a search engine, and as a sample, I was indexing the p5p archive
and I was wondering why some days took so much longer than other days to index
turns out, those days had 600+ messages on the mailing list / day
that's almost one message every 2 minutes, continuously 19:39
and they were a lot of not so friendly happy messages :-( 19:40
19:50 notna joined 19:54 coleman joined
Nemokosch I don't know and maybe I don't even wanna know. I think I've expressed my own principle already. I just happen to think that 1. Perl is really good for certain things and 2. leaving people space and freedom to develop their own style and own cleverness is inspiring 19:54
I don't regret starting Raku and I think the world would be a bit emptier place without it 19:55
19:55 coleman left, coleman joined
but in the end, it's "just" a programming language, not a manifesto or something 19:56
20:03 notna left 20:11 eseyman left
at > but in the end, it's "just" a programming language, not a manifesto or something 20:13
raku feels more like a manifesto in the intentional way the community is built & the thought put into it
Ofun and all that
ecocode___ hi, I'm pretty old and my eyes prefer reading stuff on e-ink device instead of web-browser. By any chance, is the raku guide and/or the raku documentation available in epub format ? 20:37
at Pod can render Markdown that you can throw at pandoc to get epub, you should be able to do that with the docs docs.raku.org/language/pod#Markdown 20:40
[Coke] the epub version has been broken for some time.
ecocode___ how come ? 20:41
[Coke] well, single file version. not strictly speaking an epub format.
ecocode___: bitrot. there's an open ticket, needs to be addressed.
ecocode___ ok thx 20:42
20:42 eseyman joined
[Coke] github.com/Raku/doc/issues/3041 github.com/Raku/doc/issues/1981 (I'm sure there are others) 20:44
Please follow those tickets; hopefully once the build is unblocked, we can start addressing these issues again. 20:46
ecocode___ raw.githubusercontent.com/hankache...intro.adoc ... what format is that ? 20:56
euandreh ecocode___: looking at the extension, asciidoc 20:58
El_Che ecocode___: lo! Long time no see 20:59
Nemokosch mhm, this is exactly why I got into debate 21:04
ecocode___ El_Che: hello ! 21:06
I figured to get the raku guide in epub :) (```asciidoctor``` and ```pandoc```) 21:11
21:42 linkable6 left, evalable6 left 21:43 evalable6 joined, linkable6 joined
ecocode___ Not really readable though... 21:46
Guess I will have to read the web
at ecocode___: pandoc can read Asciidoc directly, maybe skipping `asciidoctor` could help layout-wise? 21:50
21:51 lichtkind_ left 21:53 n1to left
ecocode___ Hah? It did not like it on my system 21:57
at ecocode___: pandoc.org/demos.html example 28, looks like it needs some special syntax 21:58
ecocode___ Therefore I used asciidoctor to convert to docbook to feed pandoc
I'll check again tomorrow 22:00
at pandoc -s perl6intro.adoc -t asciidoc -o out.epub, no?
ecocode___ Such a potty Merello book (raku recipes) isn't sold in Epub, but pdf only 22:01
I'd love to read that one
El_Che that sounds like an insult
potty Merello
msg him and ask 22:02
ecocode___ Ouch
Maybe I'll just buy the printed book
El_Che: you use raku in production? 22:03
22:05 pierrot left 22:06 pierrot joined 23:06 bloatable6 left, quotable6 left, reportable6 left, linkable6 left, statisfiable6 left, releasable6 left, evalable6 left, nativecallable6 left, bisectable6 left, coverable6 left, greppable6 left, committable6 left, tellable6 left, benchable6 left, shareable6 left, sourceable6 left, notable6 left, unicodable6 left, shareable6 joined, sourceable6 joined, bloatable6 joined 23:07 releasable6 joined, tellable6 joined, greppable6 joined, committable6 joined, benchable6 joined, nativecallable6 joined 23:08 evalable6 joined, quotable6 joined, coverable6 joined, statisfiable6 joined, linkable6 joined, unicodable6 joined, bisectable6 joined 23:09 reportable6 joined, notable6 joined 23:15 wingfold left