🦋 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.
00:04 aborazmeh left 00:25 mowcat joined 00:37 guifa2 left 00:44 hungrydonkey joined 00:47 aborazmeh joined, aborazmeh left, aborazmeh joined, squashable6 left 01:15 molaf left
[Coke] yawns. 01:16
01:27 molaf joined 01:41 ex_nihilo joined 01:44 leont left
guifa is thinking about making a psuedo app bundle in macOS just to give raku files their own icons 01:57
02:14 zacts joined 02:18 hungrydonkey left, hungrydonkey joined 02:20 perlbot_ joined, hoelzro_ joined, hungrydonkey left, Altreus_ joined, hungrydonkey joined, jcallen_ joined, ssm_ joined 02:21 yuplushi_ joined 02:26 hungryd83 joined, hungrydonkey left 02:27 hungrydonkey joined, hungryd83 left, yuplushi left, CIAvash left, kiti_nomad[m] left, moon-child left, ssm left, perlbot left, hoelzro left, Altreus left, jcallen left, perlbot_ is now known as perlbot 02:28 hungryd80 joined, hungrydonkey left 02:30 hungryd80 left 02:31 hungrydonkey joined 02:32 hungryd68 joined, hungrydonkey left 02:33 hungryd68 left, hungrydonkey joined, kiti_nomad[m] joined, CIAvash joined, moon-child joined 02:34 kiti_nomad[m] left, kiti_nomad[m] joined, hungrydonkey left, hungrydonkey joined 02:37 stanrifkin joined
stanrifkin what does zef stand for? Is it a abbreviation? 02:38
02:42 hungrydonkey left
guifa stanrifkin: I don’t believe it has any meaning, it’s just short, pronounceable, and not taken :-) 02:43
stanrifkin guifa: OK 02:44
guifa but who knows, maybe ugexe is just from NC originally and used to fly out of the ZEF airport all the time ha 02:52
03:08 Kaiepi joined 03:15 vrurg left 03:20 Sgeo left, Sgeo joined 03:42 guifa2 joined
rypervenche I'm trying to figure out how to take a bag and get the weights in descending order and then map the key and values to variables, but I'm having trouble figuring it out. I've got: $bag.antipairs.sort(-*.key).map: -> but I'm not sure what signature will get me what I want. I think I need to decont it, but can't find the right combination. 03:52
03:56 mowcat left 03:59 zacts left
parabolize rypervenche: I'm not sure what you want the variables to be. maybe this? 04:09
:m say [ bag( < a a a b b c c c c >).pairs.sort(-*.values) ]
rypervenche So I got it to work with 2 for loops, but I feel like it could be done in a single map somehow. I'm trying to get the (sorted) weight and value into variables to be used later: gist.github.com/rypervenche/1d3e0a...c242899bce 04:14
guifa2 can I get some sample data to run with that? 04:28
rypervenche It's from a larger script with a few different data sources. I'll come up with a small example tomorrow to simply things. 04:31
guifa2 m: my $bag = Bag.new(<a d a b a c a d a a a b b b b b c a c c d d d>); for $bag.pairs.sort(-*.value) -> (:$key, :$value) { say "$key ($value)" } 04:33
camelia a (8)
b (6)
d (5)
c (4)
guifa2 That should work 04:34
and if you prefer different variable names
-> ( :key($new-key-name), :value($new-value-name) )
04:38 cpan-raku left 04:39 cpan-raku joined, cpan-raku left, cpan-raku joined 04:57 aborazmeh left 05:07 stanrifkin left 05:13 xinming left, xinming joined 05:34 sno left 05:42 bocaneri joined 05:44 aluaces joined, sftp left, sftp joined 05:51 bocaneri left, bocaneri joined, bocaneri left 05:54 ex_nihilo_ joined 05:55 ex_nihilo left 05:56 molaf left 05:57 ex_nihilo__ joined 05:58 ex_nihilo__ left 06:00 jmcgnh left, ex_nihilo_ left 06:02 ufobat joined, sno joined 06:04 jmerelo joined
jmerelo releasable6:status 06:04
releasable6 jmerelo, Next release will happen when it's ready. GitHub is down. There are no known blockers. Changelog for this release was not started yet
jmerelo, Sorry kid, that's not my department.
06:05 jmcgnh joined 06:11 stoned75 joined 06:19 bocaneri joined 06:28 aborazmeh joined, aborazmeh left, aborazmeh joined 06:29 aluaces left 06:55 Sgeo left 06:59 domidumont joined 07:00 samcv left 07:05 sena_kun joined 07:10 aluaces joined 07:16 kensanata joined 07:19 skids left 07:32 aluaces left 07:38 dakkar joined 07:52 rindolf joined 07:57 agentzh left 07:58 agentzh joined, agentzh left, agentzh joined 08:17 andrzejku joined 08:22 Altai-man joined 08:25 sena_kun left 08:55 BenGoldberg left 08:58 sno left 09:00 sno joined 09:02 Altreus_ is now known as Altreus 09:07 stoned75 left 09:13 stoned75 joined 09:31 aluaces joined 09:59 k-man left 10:00 abraxxa left, abraxxa joined 10:04 abraxxa left 10:05 abraxxa joined 10:09 domidumont left 10:19 Black_Ribbon left 10:20 sno left 10:26 k-man joined 10:35 MasterDuke left 10:37 MasterDuke joined 10:46 sno joined 10:53 leont joined
raku-bridge <frost> I want to know the difference of multi { } and multi sub { }, or are they the same? 10:55
10:57 andrzejku left 10:58 timlegge left
Altai-man They are the same, multi without anything default to multi sub. Be careful with `multi method` in a class, there `method` has to be specified for this reason. 10:58
s/default/defaults/ 10:59
11:02 Benett left, Benett joined 11:18 MasterDuke left 11:21 stoned75 left 11:30 MasterDuke joined 11:45 BenGoldberg joined 12:13 smotchkkiss joined 12:18 domidumont joined 12:19 BenGoldberg left 12:22 BenGoldberg joined 12:23 sena_kun joined 12:25 Altai-man left 12:27 jmerelo left 12:29 ufobat_ joined 12:32 ufobat left 12:35 andrzejku joined 12:48 ensamvarg3 joined 13:04 pierrot_ is now known as pierrot 13:05 pierrot left, pierrot joined
raku-bridge <frost> Thanks 😘 13:05
rypervenche guifa2: Thanks! That's exactly what I was looking for. I know you've shown me the syntax before, but I couldn't remember it or find it anywhere. :P 13:09
JJAtria[m] Is there a Raku equivalent to weak refs? I'm thinking of how they are used in eg. Perl to avoid memory leaks. Or is that something that doesn't translate to Raku? 13:25
13:30 skids joined 13:32 domidumont left
moritz Raku uses a "proper" garbage collector (not ref counting), so you don't need to avoid circular data structures 13:38
there are some *very* few cases where you could still use weak references; I don#t think we have a good solution for that yet 13:39
andrzejku hey guys 13:49
do you know how raku gaming stands now? 13:50
guifa I don’t think anyone has done any games wtih it except for a few command line things
MasterDuke timotimo has done a demo or two with the SDL bindings 13:51
andrzejku yes timotimo was done a game
and tadzik
guifa made a Rakudo.js loading status image 13:55
github.com/alabamenhu/IntlX/blob/m...imated.png
JJAtria[m] moritz: Thanks! 13:56
14:03 Sgeo joined 14:08 zacts joined 14:19 aluaces left
[Coke] (loading status image) owmyeyes. :) 14:33
tellable6 2020-09-23T03:16:51Z #raku-dev <Kaiepi> [Coke], can i talk to you next time you're on?
[Coke] Kaiepi: you can try, but my time on IRC is sporadic. 14:40
Kaiepi: what's up?
14:42 zacts left 14:44 ensamvarg3 left
guifa [Coke]: she goes solid all colors when it’s loaded. I got bored last night lol 14:49
[Coke] guifa: :) 14:51
14:52 ensamvarg195 left
guifa is there a way to pass args to a module loaded with -M ? 14:52
Altreus It looks like when I press the cycle colours button in fractint
in p5 it was -MModule=import,list 14:53
perhaps this?
guifa ah hmm I’ll try that 14:54
14:56 defaultxr left
guifa :-( no dice 14:57
14:58 ensamvarg3 joined, zacts joined, ensamvarg3 left 14:59 defaultxr joined 15:02 MilkmanDan left 15:03 MilkmanDan joined 15:08 hungrydonkey joined 15:16 zacts_ joined 15:18 zacts left, hungrydonkey left, hungryd65 joined 15:21 hungryd65 left, hungrydonkey joined 15:22 zacts_ left, hungrydonkey left, zacts joined
[Coke] wonders why hacktoberfest repo is not using artistic. 15:35
15:36 afresh1 joined, sftp left 15:37 sftp joined, dataangel left 15:43 ufobat_ left 15:51 smotchkkiss left 16:22 BenGoldberg left, Altai-man joined 16:24 kensanata left 16:25 sena_kun left 16:32 aluaces joined 16:38 lucasb joined 16:39 dakkar left 16:45 andrzejku left 16:47 gibranrosa joined
gibranrosa p6: say 3; 16:47
camelia 3
gibranrosa m: say 3;
camelia 3
gibranrosa m: say now - INIT now
camelia 0.00110039
16:52 aluaces left 16:57 pduh joined, approaching236 joined
pduh list 17:00
17:01 pduh left 17:09 zacts left 17:20 andrzejku joined 17:22 aluaces joined
codesections 17:32
[Coke] 17:36
m: "".uninames.say 17:37
camelia ()
[Coke] :P
codesections m: say ''; 17:38
camelia
[Coke] I had used a unicode space in my blank send, but something got lost in translation. :)
17:51 molaf joined 17:52 andrzejku left 18:06 molaf left, pduh joined, pduh left 18:07 peterduh joined 18:09 peterduh left
Xliff andrzejku: The pieces are there to make some really nice games in Raku. 18:24
tellable6 Xliff, I'll pass your message to andrzejku
Xliff andrzejku: However Raku's performance issues (particularly compiling) are offputting to most game developers. 18:25
tellable6 Xliff, I'll pass your message to andrzejku
Xliff I actually wrote a generic card deck class a while ago. Never took the time to make a formal game out of it.
andrzejku: I actually wrote a generic card deck class a while ago. Never took the time to make a formal game out of it. 18:26
tellable6 Xliff, I'll pass your message to andrzejku
18:28 Black_Ribbon joined 18:36 andrzejku joined 18:49 Possum joined 18:53 timlegge joined 19:04 riceandbeans left 19:13 BenGoldberg joined 19:15 andrzejku left 19:19 |oLa| joined 19:26 lucasb left 19:35 rindolf left 19:46 BenGoldberg left 19:57 molaf joined 20:20 lucasb joined 20:22 mowcat joined 20:23 sena_kun joined 20:25 Altai-man left 20:49 rjeli left, Grinnz left, tbrowder left 20:50 PotatoGim left, timeless left, kawaii left, dog_star left, jhill left, caasih left, mithaldu_ left 20:51 rjeli joined, tbrowder joined, dylanwh left, mrsolo left, skaji_ left, Grinnz joined 20:52 dog_star joined, dylanwh joined, caasih joined, kawaii joined, timeless joined, BuildTheRobots joined 20:53 mrsolo joined, mithaldu_ joined, PotatoGim joined 20:54 jhill joined, skaji_ joined 20:59 sena_kun left 21:07 smotchkkiss joined
rypervenche Is it possible to use gather/take with a map? For example, I'm looping through some lines in an array and only taking items if they match a certain criteria and then assigning all of that to a variable. I've got it working with a for loop right, but haven't been able to figure out how to do it with a map (so I can hyper it). I'll give an example of the code so it makes more sense. 21:15
MasterDuke you probably want a grep? 21:17
timotimo you can also hyper a for, it has to be a "hyper for", though 21:19
rypervenche The portion of code in question: gist.github.com/rypervenche/326be5...eb38fde7af
I converted it to a map with a hyper, but I couldn't find any place to put a gather. 21:20
hyper for :O
Hmm, I can't change batch and degree though when using "hyper for", can I? 21:23
timotimo you can, you'll need to "hyper for @blah.hyper(...) { ... }"
rypervenche Ahhh 21:24
21:24 dudz left 21:33 |oLa| left 21:44 aluaces left
rypervenche Hmmm, gather still doesn't work when I use hyper for. I get "Died at: take without gather" 21:49
timotimo oh 21:50
i should have pointed this out before 21:51
with gather/take where you're take-ing from hypered workers, you would be accessing an array concurrently
that's a big no-no
you can return an array from each map or for block and slurp them all together afterwards, or send values to a Channel 21:52
Xliff You'd need a Lock
Channel would be better, I suspect
21:54 smotchkkiss left 21:55 SmokeMachine left 21:56 SmokeMachine joined, cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined
rypervenche Hmmm, ok. I'll poke around the documentation to see if I can figure that out. If not, it's not the end of the world. Just wanted to shave off some time from this little script. 21:57
22:00 abraxxa left 22:02 abraxxa joined 22:03 gibranrosa left
Xliff Who is handling raku support for Repl.it? 22:08
rypervenche: Any luck? 22:21
rypervenche Haven't started yet. I'll have to reorganize it a bit in my test to work with promises. 22:25
guifa had to do an assignment for his CS class in Java and it was ugly 22:26
Xliff You shouldn't need any promises. Just a channel.
See my comment on your gist.
guifa In Raku I could have done it in like five 20-char max lines
unclechu hey, is there any way to define some text for `--help` with line breaks? smth like #|«…» before MAIN function would associate it with particular multi-sub pattern and would remove any line breaks 22:27
I want to add some generic description 22:28
Xliff unclechu: Write a sub USAGE { } that adds to $*USAGE var
22:30 lucasb left
Xliff unclechu: See here github.com/Xliff/p6-GtkPlus/blob/m...xample.pl6 22:30
unclechu Xliff: thanks! 22:31
Xliff unclechu: Live sample -- repl.it/@Xliff/PersonalModernRobots#main.raku 22:33
rypervenche Xliff: Oooh, I'll try that out. 22:34
Xliff unclechu: Check the repl.it again. It's cleaner
unclechu Xliff: why does example from the first link uses `nqp` in order to concatenate string with `$*USAGE`?
Xliff Old code
Back when I originally wrote this, that was the only way to access $*USAGE. It's unnecessary, now 22:35
unclechu Xliff: okay, i just realized i don’t need nqp there
Xliff Oops! Sure don't. ;) 22:36
rypervenche Xliff: Out of curiosity, couldn't I replace (my $s = $c.Supply).tap with $c.Supply.tap ?
I don't see you using the $s anywhere else in the gist. 22:37
Xliff rypervenche: I was wondering about that. The only reason I assign to $s is to make sure the Supply object doesn't fall out of scope.
That might not be necessary
22:38 BenGoldberg joined 22:41 stanrifkin joined
stanrifkin with what algorithm is is-prime implemented in? AKS-test or Fermat primality test? 22:42
Xliff stanrifkin: Miller-Rabin according to the docs 22:43
stanrifkin i didn't find it in the docs 22:44
Xliff docs.raku.org/type/Int#routine_is-prime
guifa I swear I remember Damian doing a whole conference talk on it but I can’t seem to find it 22:45
but maybe it was jnthn or someone else? 22:46
stanrifkin i watched the talk, but he mentioned different methods
guifa oh yeah
www.youtube.com/watch?v=Nq2HkAYbG5o
ah I thought I remmeber him saying that one is the one that’s used in Raku
stanrifkin guifa: ok, than i missed it 22:47
guifa stanrifkin: I could be wrong though. It’s been a while since I watched the video
timotimo wakelift.de/p/64fec54c-8b69-4dd1-8...23d13ddbf/ - who wants to proofread my blog post 22:48
22:50 timeless left, dog_star left, rjeli left, Grinnz left, dylanwh left, skaji_ left, SmokeMachine left, spycrab0 left, mrsolo left, pnu__ left 22:51 caasih left, PotatoGim left, BuildTheRobots left, tbrowder left 22:52 SmokeMachine joined, peteretep left, dylanwh joined, rjeli joined 22:53 timeless joined, skaji_ joined 22:54 Celelibi left, Grinnz joined, peteretep joined, pnu__ joined
stanrifkin i don't understand the design choice with sub routine parentheses sub f(...) and sub f (...). i think that's another rule to remember and always forget when someone comes to raku again. 22:54
22:54 tbrowder joined 22:55 caasih joined, mrsolo joined, dog_star joined, spycrab0 joined 22:57 PotatoGim joined, BuildTheRobots joined 22:58 rjeli left
AlexDaniel stanrifkin: what's the alternative? 23:06
23:06 Celelibi joined
stanrifkin AlexDaniel: use a reference 23:07
AlexDaniel stanrifkin: I'm talking about sub f(...) vs sub f (...) 23:08
23:09 raku-bridge left, raku-bridge joined, raku-bridge left, raku-bridge joined 23:12 rjeli joined
stanrifkin AlexDaniel: sub f($a, $b, $c) are three arguments and sub f ($a, $b, $c) is one argument i. e. a list with my understanding... 23:12
AlexDaniel stanrifkin: yes, but what would be the alternative design choice? 23:13
stanrifkin AlexDaniel: in perl i used sub f(\@arr) for that... maybe than something like sub f(\($a, $b, $c)) but maybe that's more irritating 23:14
AlexDaniel ahh 23:15
stanrifkin :)
AlexDaniel actually would've been interesting to have no list type, just mutable arrays. Then () syntax would not be there, so f (42, 43) could be a function call 23:17
edgy, I know, but it's a possibility :) 23:18
not the most wonderful possibility though :P 23:20
stanrifkin: there was a discussion some years ago about the preferred style for sub declaration 23:21
stanrifkin: actually, rereading this conversation, I'm not entirely sure what we're talking about exactly :) 23:22
Grinnz thinks its better than spaces having no syntactical significance
AlexDaniel stanrifkin: thing is, `sub foo () {}` is actually valid
so you can define your subs this way, but you cannot use the same syntax to call them 23:23
Grinnz in perl say (something)[0] attempts to run say(something) and then has a syntax error, because that makes sense :P 23:24
AlexDaniel a lot of people prefer the space for some reason, but IIRC even more people argued that the preferred style should be without a space, this way I guess you're less likely to assume that it'd be valid to call your subs this way
Grinnz i very much prefer requiring no space between symbol and opening parentheses for calls 23:25
because that solves taht ambiguity in particular
in raku it's more complicated since it actually means something different
timotimo there's always slang::tuxic to do the space thing differently 23:30
stanrifkin AlexDaniel: I missed the point that defining the sub the space is valid. OK. I get used to that. 23:33
23:33 guifa left 23:34 guifa joined
AlexDaniel timotimo: and how is that useful in practice? 23:34
timotimo dunno, i didn't read enough of the discussion i guess 23:35
AlexDaniel timotimo: it's not about the discussion, but about the whole idea
of having modules that introduce slight syntax changes
timotimo if you don't like a (1, 2) being one argument, use slang::tuxic and it no longer is that way, hooray 23:36
AlexDaniel and then say you go to work, and what happens? You convince all your colleagues to add `use Slang::Tuxic` to all of the files? 23:37
or you don't, and then you'd probably be writing it the wrong way by acciddent
Slang::Tuxic is a party trick, that's it 23:38
timotimo hm, does tuxic break when you use it inside curlies? 23:39
AlexDaniel slangs are fantastic for relatively big features, say inline SQL or anything like that. But suggesting to use them for minor syntax differences is just out of touch 23:40
because what we have here is actually a trap in the language. If we had Raku::Critic I guess it would've been easy to add a check for that, but it seems like we're missing an alternative also 23:42
for example, say you write `foo (1, 2, 3)`. Then Raku::Critic could've warned you about it because maybe you didn't mean it
but… what would it say? 23:43
23:43 pduh joined
AlexDaniel like how can you write explicitly that you meant it. foo((1, 2, 3)) ? Ew. 23:43
timotimo m: sub foo(*@x) { dd @x }; foo\ (1, 2, 3) 23:44
camelia Array element = [1, 2, 3]
timotimo m: sub foo(*@x) { dd @x }; foo (1, 2, 3)
camelia Array element = [1, 2, 3]
timotimo m: sub foo(*@x) { dd @x }; foo(1, 2, 3)
camelia Array element = [1, 2, 3]
timotimo ah, right
AlexDaniel yeah, that's the opposite I think :)
timotimo m: sub foo(**@x) { dd @x }; foo (1, 2, 3); foo\ (1, 2, 3); foo(1, 2, 3); foo((1, 2, 3))
camelia Array element = [(1, 2, 3),]
Array element = [1, 2, 3]
Array element = [1, 2, 3]
Array element = [(1, 2, 3),]
timotimo right, it is
AlexDaniel not enough ASCII parens, I guess 23:46
or maybe an optional colon could've done it
foo: (1, 2, 3) 23:47
sure, that's a label, but I don't know why labels need to have this neat syntax :
:)
23:48 pduh left 23:49 leont left 23:50 peterduh joined
timotimo why did labels get the colon, we may never know 23:52
rypervenche Xliff: Interestingly, when I try what you sent, it no longer sees my variable... Updated gist.github.com/rypervenche/326be5...eb38fde7af 23:59