Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
Nicholas Servus, #moarvm 05:49
nine Morgen! 06:13
jnthnwrthngtn Ahoj! 08:58
Nicholas jnthnwrthngtn: a friend I was with at the weekend is learning Czech using duolingo. duolingo offered the following phrase (in English and Czech): I drink beer because I am thirsty 09:00
jnthnwrthngtn Me too duo, me too... :) 09:04
Nicholas that was what we both thought. 09:05
jnthnwrthngtn The microbrewery I go to now and then, which usually makes reliably nice beers, recently made a mint APA. I think it's the first beer I've had in a while that I questioned not finishing. 09:22
uh, s/questioned/considered/ 09:23
MasterDuke huh. that sounds like an IPA i might actually like. you don't like mint? 09:24
jnthnwrthngtn I do like mint. I do like IPA/APA. 09:27
Somehow their combination didn't work for me. Or at least, this combination didn't. 09:28
nine Lot of people like fish. Even more people like chocolate. For some reason, Zotter's fish chocolate (yes, for real) didn't take off though. 12:18
Nicholas Herr Zotter has some crazy ideas. There's a graveyard for them roughly here: www.google.com/maps/@46.9916884,15...a=!3m1!1e3 12:28
(the factory tour is fun)
MasterDuke huh, never heard of them
drakonis is there any documentation for experimental rakuast and slang usage? 19:55
highly possible this is the wrong channel 19:57
drakonis also how to write a new trait to modify moarvm behavior when dealing with recursive functions 20:01
as it is the kind of change that needs to go on the vm 20:02
[Coke] in the rakuast branch, there's src/Raku/ast/README.md 20:03
jnthnwrthngtn drakonis: If it's about supporting tailcalls, I guess places to start reading in MoarVM are github.com/MoarVM/MoarVM/blob/mast...allstack.h for stack layout and around github.com/MoarVM/MoarVM/blob/4e2e...ame.c#L455 for where stack frame creation is driven. 20:26
drakonis i see
jnthnwrthngtn I suspect it'd then want to be plumbed in NQP somewhere. How exactly depends on the semantics you're shooting for. 20:28
drakonis hmm, looks like there's multiple ways to achieve it 20:29
jnthnwrthngtn Although most probably you'd need a new boot-tailcall dispatch terminal
drakonis one where you can explicitly transform a procedure call into a tail call
ocaml.org/releases/4.14/htmlman/ta..._cons.html as seen here
as opposed to just the returning procedure call 20:30
the semantics seem similar to what i'd want to do
although it is still experimental 20:31
jnthnwrthngtn I kinda wonder if it'd be possible, when AST is availble in traits, to avoid doing any VM stuff and just rewrite it as a loop in RakuAST
drakonis i'm not sure whether doing that would always map correctly to recursive functions that aren't really loops 20:32
ie: traveling a tree structure
traversing or generating trees 20:33
or dealing with anything deep 20:35
jnthnwrthngtn Yeah, I'm not sure off hand 20:38
Also jnthn.net/papers/2021-trc-dispatch.pdf is maybe of interest in parts (it explains how calls work) 20:39
Among the many semantics to figure out are if a recursive call in a multi candidate should call the proto 20:40
Which brings up the issue I've mentioned before, that what MoarVM thinks of as a stack frame may not be the thing you think of as a function 20:41
So doing this well might actually mean pealing off multiple VM level frames. I dunno where the arguments of the recursive call should be stored, although one would need to ensure the GC can find them 20:43
drakonis also, loops can be implemented with recursion 20:47
but modelling a traversal algorithm for non contiguous data structures sucks 20:49
drakonis while you're still here, i wanted to ask about multiple dispatch and constraints being used together in a similar manner to pattern matching 20:52
guards 20:53
jnthnwrthngtn OK, what's the question? 20:56
I mean, multiple dispatch constraints and signature unpacking can do stuff like pattern matching/destructuring. 20:57
drakonis with enough patience, it should be possible to combine those together into a keyword for pattern matching, yeah? 20:59
seems like it'd require wading in rakudo's guts for this 21:00
drakonis alternatively, the real question is whether code can be reduced to syntatic sugar 21:01
drakonis ie: pattern matching being syntax sugar for the combination of multiple dispatch constraints and signature packing 21:01
or is that still going to require rakuast to even do that? 21:02
syntax sugar is another kind of codegen isnt it 21:05
jnthnwrthngtn I think at some point it was speculated what `when` with a signatured (pointy) block would accept if the signature matched, although that never got implemented thus far. But if you want to do syntax sugar stuff, yes, that's probably a slang + rakuast job, and it's not really at a point where one can easily do that yet
drakonis that does dampen my excitement at the moment 21:08
but it should be worth the wait 21:11
MasterDuke if people are around and up for some thinking, any thoughts on github.com/MoarVM/MoarVM/pull/1685 or github.com/MoarVM/MoarVM/pull/1645 ? 21:19
or github.com/MoarVM/MoarVM/pull/1470 21:20