🦋 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:00 djerius left 00:01 djerius joined 00:02 reportable6 left 00:03 Skarsnik left, reportable6 joined 00:35 rbt joined
SmokeMachine I've just added some more data to my advent calendar post draft. if someone have some time to prof read it: gist.github.com/FCO/8ad2bd4cc3723e...e1690ed9df thanks 00:42
00:54 gcd joined 01:02 frost joined 01:04 colemanx left, colemanx joined, getimiskon left 01:09 rbt left, rbt joined
at Hey, is rakubrew.com down? 01:24
Looks like it's just the root page, the sh file for installing it's still being served 01:25
ugexe its .org i though 01:30
looks like .org is down though
01:31 frost left
at Err, yeah, I meant .org 01:31
01:35 frost joined
frost ah, so funny, tikolu.net/emojimix/%F0%9F%98%82+%F0%9F%A4%91 02:09
02:11 hexology joined 02:39 rbt left, rbt joined 03:39 committable6 left, bloatable6 left, coverable6 left, squashable6 left, reportable6 left, evalable6 left, linkable6 left, benchable6 left, shareable6 left, quotable6 left, releasable6 left, unicodable6 left, nativecallable6 left, greppable6 left, notable6 left, tellable6 left, sourceable6 left, bisectable6 left, statisfiable6 left 03:40 rbt left, rbt joined, unicodable6 joined, bloatable6 joined 03:41 linkable6 joined, notable6 joined, bisectable6 joined, benchable6 joined, sourceable6 joined, committable6 joined 03:42 tellable6 joined 03:45 rbt left, rbt joined, rbt left, rbt joined 04:25 rbt left 04:26 rbt joined 04:40 shareable6 joined 04:41 reportable6 joined 04:42 evalable6 joined, squashable6 joined, quotable6 joined 04:43 coverable6 joined 04:51 rbt left, rbt joined, rbt left
samebchase m: (Date.new(2021,11,30) .. *).head(2)>>.&{ say "day is {$_.day}" }; 05:31
camelia day is 30
day is 1
samebchase I've been able to get this working using a topic variable, however my question is how do I create an inline lambda that takes in an arbitrary signature 05:32
meaning, if my sequence has a list of size-2 lists, I would like to do something like (SEQ-OF-SIZE-2-LISTS)>>.&{ ($a, $b) -> { say "$a, $b" }} 05:34
[(1,2), (3,4)]>>.&{ <LAMBDA-BODY> }, what's the syntax of defining lambdas that work with hyper operators with the "." method call syntax 05:36
05:40 nativecallable6 joined
samebchase m: (1 .. 2 X 3 .. 4)>>.&{ say $^a; }; 05:40
camelia 1
samebchase how do I deal with the data as pairs and not flattened
m: (1 .. 2 X 3 .. 4);
camelia WARNINGS for <tmp>:
Useless use of "X" in expression ".. 2 X 3 .." in sink context (line 1)
05:40 greppable6 joined
samebchase m: (1 .. 2 X 3 .. 4); 05:41
camelia WARNINGS for <tmp>:
Useless use of "X" in expression ".. 2 X 3 .." in sink context (line 1)
samebchase m: say (1 .. 2 X 3 .. 4);
camelia ((1 3) (1 4) (2 3) (2 4))
samebchase I want these "pairs" to be given the the lambda without flattening them, so 4 items, instead of 8 items. 05:42
05:42 statisfiable6 joined
samebchase "Whether hyperoperators descend into child lists depends on the nodality of the inner operator of a chain. For the hyper method call operator (».), the nodality of the target method is significant." from docs.raku.org/language/operators#i..._operators 05:44
how do I define an inline lambda here, which does not force the hyper operator to not descend into an inner list? 05:48
Something like: (1 .. 2 X 3 .. 4)>>.& -> ($a, $b) { say $a, $b }; where $a is 1 and $b is 3 on the first iteration 05:51
elcaro samebchase: use .map 05:56
(1 .. 2 X 3 .. 4).map(-> ($a, $b) { ... })
(1 .. 2 X 3 .. 4).map: -> ($a, $b) { ... } # Alternate syntax 05:57
samebchase elcaro: I understand `map` does that as it allows you to pass in a block. I was just wondering if there was a way to easily pass in arbitrary blocks with hyper operators. 05:59
I guess `map` is idiomatic here, and hyper operators are better off when the data is not nested. 06:00
elcaro you can't stop a hyper-operator from decending into children unless you explicitly specify the nodality, which you can really only do with a routine trait
yeah, I personally think `».&` is an anti-pattern outside of golfing 06:01
06:02 reportable6 left
elcaro m: sub f($xs) { $xs.elems }; sub g($xs) is nodal { $xs.elems }; say (1 .. 2 X 3 .. 4)».&f; say (1 .. 2 X 3 .. 4)».&g 06:03
camelia ((1 1) (1 1) (1 1) (1 1))
(2 2 2 2)
samebchase my &f = sub ($a, $b) is nodal { say $a, $b }; followed by [(1,2),(3,4),]>>.&f; , but I still get the error "Too few positionals passed; expected 2 arguments but got 1" 06:04
elcaro i don't think there's any way to say a lambda `is nodal` and even if there was, it would be noisier that just using `map`
samebchase wait, let me see what you've just typed
elcaro you sub is not receiving 2 arguments... it's receiving a list of 2 elems 06:05
samebchase Ah, my function is expecting two args,
instead I need to destructure
elcaro unless you unpack in the sub
samebchase got it!
thanks so much elcaro
elcaro yeah like sub (@ [$a, $b]) { ... }
samebchase tl;dr: Use map, and don't mess with "is nodal" 06:06
06:06 swaggboi left
samebchase Earlier, the use of ">>" as opposed to a map or a loop used to make me feel anxious, but now I think I'm overdoing hyperoperators in my quest to understand them. 06:07
elcaro yeah, plus `».` is not lazy, so it's not always ideal for that reason 06:08
I use them sparingly, usually to avoid map-inside-map, ie. I will typically prefer `*.map(*».foo)` over `*.map(*.map(*.foo))` 06:09
06:19 swaggboi joined
samebchase hmm ncie 06:21
06:38 rbt joined, rbt left 06:39 rbt joined 06:42 releasable6 joined 06:44 rbt left 07:27 seednode left 07:28 seednode joined 07:33 gordonfish- joined, gordonfish left 07:43 andrzejku joined 07:44 jmcgnh left, Xliff joined, kylese joined
Xliff How can I introspect .mvmheap files? 07:45
Ah! moarperf
07:54 patrickb joined 07:55 jmcgnh joined 07:56 abraxxa joined 07:58 abraxxa left 08:00 abraxxa joined, rbt joined
Xliff Hmm... moarperf is bombing for me. Does anything else allow me to read .mvmheap files? 08:03
08:04 reportable6 joined 08:05 rbt left, rbt joined 08:06 abraxxa left, abraxxa joined 08:07 rbt left, rbt joined 08:08 andrzejku left 08:12 rbt left 08:13 AAAYK1 joined 08:20 Sgeo left 08:22 frost left, frost joined 08:23 rbt joined
Xliff MoarPerf is choking on my .mvmheap files. These are generated from a (fairly) fresh rakudo. Any ideas as to a workaround? 08:32
frost m: my &f = sub (($a, $b)) is nodal { say $a, $b }; [(1,2),(3,4),]>>.&f;
camelia 12
frost samebchase ^^^ 08:33
08:38 rbt left 08:39 rbt joined, rbt left 08:52 dakkar joined 08:53 kylese left 09:03 a3r0 joined 09:29 daxim left 09:35 rbt joined 09:36 rbt left
elcaro frost: they were asking if it was possible with a point block, ie. [(1,2),(3,4),]».&(-> ($a, $b) { ... }) 09:39
I'm not aware of a way to make pointy blocks can be made nodal 09:40
can do it with anon subs, tho
say [(1,2),(3,4)]».&(sub ([$a, $b]) is nodal { $a + $b }) 09:41
evalable6 (3 7)
09:41 rbt joined 09:42 rbt left
elcaro but with that noise, you may as well just use map 09:42
09:42 rbt joined 09:47 rbt left, rbt joined, rbt left 10:08 rbt joined
timo you can possibly use duckmap to do the hypering here 10:08
10:08 rbt left
timo since hyper, as opposed to map, will traverse the struture and give the same structure back 10:08
10:08 rbt joined, rbt left
timo Xliff: what does the choking look like? 10:08
Xliff: moarperf is supposed to be able to read moar heap snapshots version 2 as well as 3 10:09
(you get 3 if libzstd is present at moarvm Configure.pl time)
10:11 discord-raku-bot left
Xliff Ah... that might be why. 10:11
Let me recompile. 10:12
10:12 discord-raku-bot joined
timo but it still shouldn't choke :D 10:14
Xliff Malformed UTF8 @ blah.,... 10:15
Didn't have -lzstd compiled in
timo i forgot why but reently we discussed perhaps shipping libzstd with moarvm and use that if it's not available in the system 10:17
10:21 pelai joined, pelai left 10:24 rbt joined 10:32 andrzejku joined
samebchase elcaro: "say [(1,2),(3,4)]».&(sub ([$a, $b]) is nodal { $a + $b })" I just wanted to know if it was possible. Glad there is way to do that, even though it is not possible with pointy blocks. 10:34
Xliff timo: You might want to make sure libzstd support is compiled into MoarVM before you compress the heap files.
10:37 rbt left 10:39 rbt joined, rbt left
timo it's not trying to do that tho 10:46
10:59 Skarsnik joined 11:10 rbt joined 11:22 lichtkind joined
qorg11 if i have a C function called with NativeCall that returned a file descriptor, how can I use that fd with IO::Handle? 11:26
11:40 rbt left 11:41 rbt joined 11:42 Skarsnik left 11:51 rbt left, rbt joined
Xliff qorg11: You're better off using NativeCall to grab the functions that use the file descriptor and use them. 11:56
12:02 reportable6 left 12:06 abraxxa left 12:08 A26F64 joined 12:14 lichtkind left 12:16 rbt left 12:22 rbt joined, rbt left, abraxxa joined
frost I want to know, if a module uses NativeCall and I import it, do I have to declare `use NativeCall` when I use other native C callings? 12:23
lizmat all use statements in Raku are lexical 12:24
so yes
m: sub ok() { say "foo" }; { use Test; ok 1 }; ok
camelia ok 1 -
frost ok, thanks lizmat 12:25
lizmat note the different versions of ok ^^
frost ok, i see
elcaro yeah, here reflects the difference between subs and point blocks 12:35
12:40 getimiskon joined 12:42 rbt joined 12:53 rbt left, rbt joined, rbt left
gfldex lizmat: Unless `package EXPORTHOW` is involved. Is that fixable in priciple? 13:00
timo slangs could do it i imagine 13:17
lizmat I'm not sure what needs to be fixed ? 13:30
timo it's more a question of breaking it than of fixing it 13:41
13:43 frost left 14:01 abraxxa left 14:18 rbt joined 14:20 abraxxa joined 14:23 rbt left 14:24 rbt joined 14:29 a3r0 left, a3r0 joined, rbt left
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/11/30/mo...ssproduct/ 14:37
perryprog gfldex you might want to link to this week's challenge in the lede of the post so people like me can be lazy if we don't remember what it was 14:38
gfldex good call
perryprog <3 thanks 14:44
14:44 dogbert17 joined
perryprog Also, awesome title 14:44
gfldex I would love to have the EVAL gone. 14:50
Nemokosch Why did you use it, then? 14:51
gfldex Because I needed that crossproduct and there is no method for that. 14:52
perryprog coughs up docs.raku.org/routine/cross
gfldex :O 14:53
Nemokosch What would you prefer instead?
gfldex List.cross ofc!
perryprog m: [1, 2, 3] X [3, 2, 1]
camelia WARNINGS for <tmp>:
Useless use of "X" in expression "[1, 2, 3] X [3, 2, 1]" in sink context (line 1)
perryprog well
m: [1, 2, 3] X* [3, 2, 1]
camelia Potential difficulties:
Useless use of X* in sink context
at <tmp>:1
------> 3[1, 2, 3] 7⏏5X* [3, 2, 1]
perryprog grumbles
I'm out of practice
gfldex m: dd cross(1,2,3 xx 3); 14:54
camelia ((1, 2, 3), (1, 2, 3), (1, 2, 3)).Seq
gfldex m: dd cross(|(1,2,3 xx 3)); 14:55
camelia ((1, 2, 3), (1, 2, 3), (1, 2, 3)).Seq
Nemokosch rip
m: dd cross((1,2,3) xx 3) 14:57
perryprog m: dd cross((1,2,3) xx 3) 14:58
camelia ((1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 2, 1), (1, 2, 2), (1, 2, 3), (1, 3, 1), (1, 3, 2), (1, 3, 3), (2, 1, 1), (2, 1, 2), (2, 1, 3), (2, 2, 1), (2, 2, 2), (2, 2, 3), (2, 3, 1), (2, 3, 2), (2, 3, 3), (3, 1, 1), (3, 1, 2), (3, 1, 3), (3, 2, 1), (3, 2, 2…
Nemokosch rip x2
perryprog I got you
14:59 rbt joined 15:02 MyButterfliable left
gfldex I updated the blogpost with this fine simplification. 15:04
15:05 reportable6 joined 15:06 abraxxa left 15:08 abraxxa joined 15:09 andrzejku left 15:24 rbt left, AAA4S2 joined 15:30 rbt joined 15:41 Altai-man joined 15:44 melezhik joined
melezhik .tell tbrowder I am going to shut mybf.io down, after 2-3 month it seems that the site is not in use ... it was unsuccessful attempt ))) , could you please remove a link from raku.org? 15:47
tellable6 melezhik, I'll pass your message to tbrowder
melezhik ^^ SmokeMachine - looks like was the only user of the web site? 15:48
^^ tbrowder
SmokeMachine melezhik: really? sad news... :( I like that idea 15:49
tbrowder melezhik: will do, sorry, you sure you want to shut it down? if it isn't hard to maintain or cost money, i would leave it up. 15:51
rakuuns, like other ppl, have desires that change all the time, so who knows when it might take off! 15:52
melezhik SmokeMachine tbrowder sorry that I upset you , the site costs me some money - 30$ a months and I am not sure if there are any real users besides maybe SmokeMachine
tbrowder oh, i'm not upset, just sorry it didn't flourish. 15:54
melezhik my idea was to spin it off and then people would do comments, but realistically irc/reddit beat me here )))
spin off -> launch 15:55
tbrowder if the code is available maybe i can run it on one of my servers
melezhik for sure, code I can share the code ... but be aware - it is not optimal and very slow ( it needs a DB instead slow file system ) - and this is a one of the reasons it eats some resources 15:56
tbrowder and reddit is not a place i visit often. maybe make yr site just for Raku modules and projects.
melezhik but overall it's just a cro application with a state kept on the file system 15:57
so if you want to give it a try I can make a GH public and you can fork , will it work?
jast now I'm curious, what was the site about? can't access it so I assume it's already down
tbrowder pls make it public (but sanitize appropriately) 15:59
gotta get back to my advent article...back later... 16:00
melezhik tbrowder sure - do you mean to remove sensitive data ?
jast I can switch it on real quick, if you are curious ... 16:01
jast a one-line summary would do it, too :) 16:02
tbrowder yes, passwords, contact data not made public already, etc., root user info...
melezhik sure 16:03
jast I switched the site on
Altreus lizmat: there's a list in this doc that didn't seem to render correctly modules.raku.org/dist/IRC::Client:...zef:lizmat
dunno whose bug it is :)
jast ohh... yeah, that's a nice idea for sure
16:04 A26F64 left 16:05 andinus joined
melezhik tbrowder let's do this - I am going to keep the site running for a couple of weeks or so and make the site source public, so you can fork it and try to host it on your own, we can arrange other stuff - like current site data - reviews/points/etc ( not a part of the repo ) and domain name later, 16:05
qorg11 Xliff: I'm trying to use read(), but is it possible to dinamycally allocate the buffer?
melezhik will it work?
tbrowder okay, let's give it a shot! 16:06
Altreus lizmat: oh, and the links don't work, but again, not sure whose bug... 16:08
melezhik tbrowder - github.com/melezhik/mybutterflies , and ... don't please bare with me , the site code is ugly sometimes :') 16:09
Altreus ah, for the links to work the URL has to end in a / and it doesn't redirect if there isn't one
melezhik bare -> bear 16:10
jast well as they say... 1. make it work 2. make it good 3. make it fast :) 16:11
and (2) has plenty of sub-steps 16:12
most of my projects stop getting updates somewhere in the middle of the first step 16:14
16:15 rbt left
melezhik yeah, I guess the concept stage is pretty much finished , the implementation part is still in progress, from my pint of view the site lacks real users who would do comments/news/updates 16:15
jast getting users is the hardest part ;) 16:17
16:21 getimiskon left 16:29 A26F64 joined 16:43 perlmaros left, Summer_ joined 16:44 japhb left, lucs_ left, bartolin_ left, Summer left 16:45 ptc left, lucs joined 16:46 japhb joined, bartolin joined, ptc joined 16:47 squashable6 left, Summer joined 16:48 Summer_ left 16:49 perlmaros joined 16:50 rbt joined 16:55 lichtkind joined 16:58 patrickb left 17:00 patrickb joined 17:05 rbt left 17:06 rbt joined 17:16 rbt left, rbt joined 17:26 Altai-man left 17:33 dakkar left 17:51 rbt left 18:02 rbt joined, reportable6 left 18:04 reportable6 joined 18:27 rbt left, rbt joined 18:35 abraxxa left 18:48 mybutterfliable joined 18:50 mybutterfliable left 18:54 rbt left 18:55 rbt joined 18:59 gordonfish- is now known as gordonfish 19:09 A26F64 left 19:20 melezhik24 joined 19:25 MyButterfliable joined 19:26 MoC joined 19:27 rbt left, rbt joined 19:29 melezhik24 left, MyButterfliable left
tbrowder yep, that's why the several young folks i know in the publicity world can make some big bucks/euros 19:42
[Coke] me: "AIGH WHY IS ADVENT POSTING HAPPENING ALREADY". me: remembers time zones exist.
tbrowder but they don't help s, 19:43
Nicholas [Coke]: you mean there are time zones other than UGT? :-)
[Coke] -1 for the explicit religious message at the end.
tbrowder *small fish much... 19:44
[Coke] my RSS feed shows me the article, but if I click to go to site, I get: raku-advent.blog/2021/11/30/santa-...ing-along/ which is a 404
tbrowder [Coke] i just discovered unposting works!
[Coke] ?? Why unpost? 19:45
I assumed it was on a schedule for Dec-01?
tbrowder cause i hit the post button inadvertently
[Coke] That'd do it
tbrowder when i wasn't ready
i hate wordpress, menus are horrible and misleading, html entry is terribly non-standard... 19:47
lizmat I wrote my blog post in markdown, committed it to github, copy-pasted the HTML representation, and was done :-) 19:48
tbrowder my article is there as draft with a scheduled post i think...something jj automated i think...
lizmat my biggest beef with WP was that it didn't allow me to schedule the post to be published at midnight 19:49
0 was not acceptable as an hour indicator :-( It would revert to whatever it had before 19:50
tbrowder i did it in pod and used Pod::To::HTML and inserted it into the code editor...had to remove the head part
[Coke] I often do 12:01 or 11:59 to avoid shenanigans. 19:52
(not in this context in particular)
floooh.github.io/tiny8bit-preview/ ... played around on the C64 emulator a bit. 19:55
19:57 rbt left 19:58 rbt joined 20:08 rbt left, rbt joined 20:13 rbt left, rbt joined 20:27 andrzejku joined 20:33 rbt left 20:34 rbt joined 20:42 andrzejku left 20:45 Skarsnik joined 20:51 MoC left 20:59 rbt left, rbt joined 21:01 p6steve joined 21:08 getimiskon joined 21:09 rbt left, rbt joined 21:11 p6steve left
Skarsnik Hello 21:12
Do I still need to use eval to add a token dynamicly to a grammar? 21:14
21:14 rbt left 21:15 rbt joined
ugexe grammar Foo { token TOP { <foo> } }; role Bar { token foo { \w+ } }; my $g = Foo.new but Bar; 21:21
Skarsnik I am talking more about .^add_method x) 21:23
21:24 p6steve joined 21:25 rbt left, rbt joined 21:29 p6steve left 21:35 rbt left, rbt joined 21:37 andrzejku joined 21:49 lichtkind_ joined 21:51 lichtkind left 21:53 Ergo444 joined
Ergo444 hi 21:53
HOw can I set a category for a package 21:54
in raku directory
21:56 squashable6 joined
Skarsnik I do $grmr.^add_method("instruction:sym<$token-name>", EVAL 'token {"' ~ $instruct.inst.lc ~ '"}'); but when I list the methods of the grammar all the token have no names. 21:59
but if I add the name of the token in the EVAL I got an error
22:01 [Coke] left 22:04 andrzejku left 22:05 [Coke] joined 22:16 rbt left, rbt joined
[Coke] . 22:21
Skarsnik ah it's fun, ^methods on grammar give you the contents of the grammar x) 22:29
the issue EVAL does not let me have the name of the token :( 22:30
Ok, need to add my in front of token. *talk to himself* 22:33
tbrowder lizmat: you still here? 22:47
Skarsnik Hm, I have another issue, I need to inherit from my generated grammar in another one (static) but... that it can't find the generated type :( 22:48
23:05 patrickb left
tbrowder well, i used lizmat's method. it works sort of, best so far, though. but not all pod get's translated well to markdown, so still had to edit one list item that should have been a code block 23:07
has any Mac user tried "MarsEdit" for offline Wordpress blogs? 23:08
or, shudder, any win ppl used MS Word? for offline Wordpress blogs? 23:09
23:26 rbt left, rbt joined 23:35 Skarsnik left 23:41 rbt left