🦋 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.
RaycatWhoDat Hi. Quick question: why does Raku's compile times start slowing down so much when you add multimethods and custom operators? Not something I do often but I was just trying some stuff out. 01:34
Geth_ doc: 4b0ecc1b59 | Coke++ | xt/words.pws
new type
01:43
[Coke] verifies that building HEAD is borked. 01:51
kawaii timotimo: hastebin.com/raw/voxipirire 02:30
hope this means something to you :) 02:31
vrurg weekly: vrurg.github.io/2020/07/18/metamod...-operators 03:15
notable6 vrurg, Noted! (weekly)
Geth_ ecosystem: 940a0d3309 | (Wenzel P. P. Peppmeyer)++ (committed using GitHub Web editor) | META.list
I renamed the repo on github for META6::bin.
06:45
ecosystem: 06501a0ddd | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #519 from gfldex/patch-4

I renamed the repo on github for META6::bin.
dolmen What is the equivalent of the .Perl method of the old days? 08:03
dolmen answer: .raku 08:12
dolmen How can I apply a Signature object on a Capture to get the expanded values? 08:28
I know that I can check IF the Capture CAN be expanded ($capture ~~ $sig), but how to retrieve the expanded values ? 08:29
(I'm especially interested in coercion and déstructuration powers of Signatures) 08:30
m: my @ ($a, +@b)⏏, $c = (['h', 'e'], 'world'); 08:42
camelia 5===SORRY!5=== Error while compiling <tmp>
Signatures as constraints on variables not yet implemented. Sorry.
at <tmp>:1
------> 3my @ ($a, +@b)7⏏5⏏, $c = (['h', 'e'], 'world');
dolmen m: my (@ ($a, +@b), $c) = (['h', 'e'], 'world'); say $a, @b, $c; 08:45
camelia (Mu)(Mu)(Any)
dolmen Doesn't work either :(
tobs dolmen: to get the positional arguments of a Capture, index it like a positional, to get the named arguments, index it like an associative 08:50
m: my $c = \('bar', :20foo, 'baz'); say $c<foo>; say $c[1]
camelia 20
baz
dolmen tobs: ok, but I wanted to use the power of signatures for coercion and restructuring. 08:53
dolmen dirty workaround: use anonymous sub to do destructuring 09:23
m: sub (@ ($a, +@b), $c) { $a, @b, $c }( 'hello'.comb, 'world' ).raku.say; 09:24
camelia ("h", ["e", "l", "l", "o"], "world")
CIAvash m: my (@ ($a, +@b), $c) := ('hello'.comb, 'world'); dd $a, @b, $c; 09:30
camelia "h"
Array element = ["e", "l", "l", "o"]
"world"
CIAvash dolmen: you need to use binding ↑ 09:31
dolmen CIAvash, nice 09:35
But doc says: "But binding Array slots directly to values is strongly discouraged" docs.raku.org/language/list#Binding
Maybe that's not a comment about binding in general but about arrays... 09:37
lizmat hmmm... I wonder if this remark: "If you do, expect surprises with built-in functions." is still true 09:39
feels like something from the Parrot days 09:40
timotimo kawaii: you literally copied the first-user/second-user test code that throws an exception for you to look at, into your code, i guess i should not have said "you literally just copypaste it in" when you still have to take that out LOL 09:55
dolmen Please retweet to enlight Python users about Raku: twitter.com/omengue/status/1284787027557351429 10:15
Petr37 anyone know hosting with Raku ? 10:37
i know,i can use vps, but maybe another solution available 10:38
Ulti dolmen: not sure that would have the response you expect from Python people, that would be seen as abhorent Python in the Python example 10:44
Ulti have to say I would really like it if Python did start to have way more people who like expressive code recently had a review that told me to remove use of the new walrus := operator :'( 10:58
Geth_ doc: e091e51c37 | (JJ Merelo)++ | doc/Type/Match.pod6
Clarification for eqv
11:05
doc: b127388623 | (JJ Merelo)++ | doc/Type/Match.pod6
Change indexing for eqv, refs #3520
doc: 5a2a7a614f | (JJ Merelo)++ | doc/Language/operators.pod6
eqv can work with certain cases of lazy arguments, refs #2639

Example taken directly from roast: github.com/Raku/roast/blob/fea1d16...tors/eqv.t but the problem is what is meant by "certain". Also created rakudo/rakudo#3803
linkable6 Link: docs.raku.org/type/Match
DOC#3520 [open]: github.com/Raku/doc/issues/3520 [docs] Unify indexing criterium for infix operators
Link: docs.raku.org/language/operators
linkable6 DOC#2639 [open]: github.com/Raku/doc/issues/2639 [wishlist][xt] split spellcheck for code
linkable6 RAKUDO#3803 [open]: github.com/rakudo/rakudo/issues/3803 Unexpected side effect of calling .raku (and effects of .eqv on lazy sequences)
doc: 9363eebf05 | (JJ Merelo)++ | doc/Language/operators.pod6
Fixes compilation error
11:07
linkable6 Link: docs.raku.org/language/operators
oddp Reading through arne's pwc solution right now. Damn, it never occured to me that you can do .grep(*.&foo) where foo is a regular sub. Sweet! 11:22
moritz you can just do .grep(&foo) 11:24
lizmat m: sub foo(\a) { a %% 2 }; dd (^10).grep(&foo)
camelia (0, 2, 4, 6, 8).Seq
lizmat pretty sure the *. is actually not needed 11:25
oddp Yeah, bad example. Still slick! 11:27
Petr37 how create module? n 11:33
maybe any tutorial ? 11:36
dolmen Ulti: I wasn't aware that Python now has generalized iterable unpacking in assignments, not just for loop. I don't write Python, and I should have check. 11:44
Ulti Petr37: this might help you docs.raku.org/language/modules-extra 11:45
Petr37 Ulti, thanks 😊 11:46
Ulti dolmen: I wouldn't have known either, because Id never get to see something like that in the wild
unpacking is a bit clunky in Python more generally though, having to do (head, *_) = iterable_thing and then wrap it in a try catch for empty list! is quite annoying 11:47
Petr37 where i can find raku tutorials? 11:50
Ulti Petr37: raku.org/resources/ "For Newcomers" on here
Petr37 Ulti, oh thanks) 11:52
Ulti m: my ($head) = []; dd $head 11:54
camelia Any $head = Any
Ulti philosophically what's the rule of thumb that being Any rather than Nil? 11:56
timotimo m: my ($head) = (my \test = []); $head = 1; say test 11:57
camelia []
timotimo m: my ($head) := (my \test = []); $head = 1; say test
camelia Too few positionals passed to '<unit>'; expected 1 argument but got 0
in block <unit> at <tmp> line 1
timotimo nope %)
Ulti huwah 12:02
codesections m: my $a = Nil; say $a 12:33
camelia (Any)
timotimo ^- assigning nil to a container resets it to its default value 12:34
m: my Str $a = Nil; say $a; my $a is default(99) = Nil; say $a
camelia Potential difficulties:
Redeclaration of symbol '$a'.
at <tmp>:1
------> 3r $a = Nil; say $a; my $a is default(99)7⏏5 = Nil; say $a
(Str)
(Str)
timotimo m: my Str $a = Nil; say $a; my $b is default(99) = Nil; say $b 12:34
camelia (Str)
99
codesections :Ulti My understanding is that Nil doesn't quite exist as a return type – that is, being Nil is esentailly being a default value. So, philosophically, it seems consistent for `[].head` to be a default value too 12:36
:timotimo, yeah, that's where I was going with that example – you just said it better/faster than I did :)
timotimo m: say Failure ~~ Nil 12:37
camelia True
timotimo ^- actually, Nil can be returned from any sub or method. Failure is also a kind of Nil, which is the reason why you can "fail" out of subs/methods even when they have return type restrictions
codesections Unrelated question: `WHY` returns the Pod value associated with an item's *type*. Is there a way to access the Pod value associated with the item itself? 12:38
Comma shows doc comments for variables, so I thought there might be. (Or maybe it just parses the doc comments on its own – I know it does its own parsing for IDE/code completion reasons) 12:39
timotimo override the method on your type and have an extra piece of storage in the instances for it?
oh
in that case you'll want the .VAR.WHY i think?
Ulti m: my (@head) = []; say @head.raku; 12:40
camelia []
Ulti m: my (@head) = Nil; say @head.raku;
camelia [Any]
Ulti m: my ($thing, @head) = []; say @head.raku; 12:41
camelia []
codesections :m my $a = 42; say $a.VAR.WHY # still tries to return the Int docstring 12:47
timotimo ah, dang 12:48
so only parameter and such have that? 12:49
cpan-raku New module released to CPAN! MongoDB (0.43.12) by 03MARTIMM 13:01
RaycatWhoDat I asked this a bit earlier but I think everyone was asleep. "Quick question: why does Raku's compile times start slowing down so much when you add multimethods and custom operators? Not something I do often but I was just trying some stuff out." 13:03
lizmat custom operators mean change of grammar 13:05
changing the grammar currently means deep-cloning it 13:06
that's just a lot of work for the Raku grammar
mind you: this only happens during compilation, has no runtime effects
which, of course, if it is a script, and not a module, currently also means runtime 13:07
there have been efforts to also pre-compile scripts, but these seem to have stalled atm
timotimo deep-cloning, huh? 13:08
lizmat no?
timotimo i thought the biggest time-sink was running the nfa optimizer over and over again?
lizmat well, and that I gues ?
*guess
I guess the nfa optimizer runs the entire grammar then 13:09
brb
timotimo not exactly, but close enough 13:10
NFA only covers the declarative prefixes, but especially with operators that tends to be very big alternations of stuff 13:11
kawaii timotimo: my bad, I think I'm also doing something wrong with it here :) hastebin.com/raw/enumuguquv 13:55
timotimo it's as i thought 13:56
the permissions array or whatever that you're putting in the junction ("in sub any at ...Junction.pm6") from your voteban code (line 81 in voteban.p6) is trying to iterate something that was already mapped over in method "combined-permissions" which you called via "has-any-permission" 13:57
kawaii: does that give the right hint? 13:58
kawaii timotimo: yes that helps us, thanks timo :D
timotimo \o/
guifa2 oddp: re your grep(.*&foo) example, that's taking advantage of a more general thing: you can use *any* sub as a method: $foo.&sub-as-method, the invocant is passed as the first argument to the sub 14:20
&sub $invocant: $arg1, $arg2; # <-- plz don't do that though it's technically possible hahaha 14:21
timotimo could you imagine ... $foo.*&bar 14:27
what would that do, invoke all possible multi candidates of &bar on $foo?
guifa2 timotimo: and this is how we discover magical secret incantatio—I mean, invocations 14:34
timotimo yeah :D
oddp guifa2: thanks, coming from d, where UFCS (dlang.org/spec/function.html#pseudo-member) is ubiquitously used throughout the language, I'm familar with that concept. Just happy the lines are blurring more and more. :) 14:41
RaycatWhoDat ^ 14:42
Nim still needs to work out its UFCS bugs, unfortunately. 14:43
Geth_ doc: 7ce9570454 | (JJ Merelo)++ | doc/Language/packages.pod6
Clarifying how dynamic lookup works (or not) in regexen, refs #2632

And only 3 to go.
16:54
linkable6 Link: docs.raku.org/language/packages
DOC#2632 [open]: github.com/Raku/doc/issues/2632 [Hacktoberfest][RFE][big][docs][good first issue][help wanted][new][⚠ Top Priority ⚠] Checklist for 6.d
Geth_ doc: 0efd6a68ec | (Trey Harris)++ | doc/Language/containers.pod6
Add link from containers to ordered/unordered role docs

I was surprised just now when I noticed the Containers doc has no links to either "Lists, sequences and arrays" or "Sets, bags and mixes".
As a wayfinding problem, I don't see a better place for it than here ... (7 more lines)
22:20
linkable6 Link: docs.raku.org/language/containers
cpan-raku New module released to CPAN! Hash2Class (0.0.1) by 03ELIZABETH 22:35
TreyHarris Hm... I was curious about Hash2Class ↑ but I'll be darned if I can find it on modules.raku.org or CPAN. I found it by going to github.com/lizmat/Hash2Class because I know lizmat's GitHub username, but if I hadn't, how would I find it? zef search doesn't know about it yet (I assume waiting on db percolation) either... 22:54
vrurg TreyHarris: the site is refreshing every 30mins, as I remember. 23:05
TreyHarris vrurg: ah, thanks