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.
00:00 reportable6 left, reportable6 joined
timo1 if we give substr a :copy, maybe Match.Str also wants a :copy 01:59
01:59 linkable6 left, evalable6 left 02:00 linkable6 joined 02:01 evalable6 joined
MasterDuke you get a :copy! everybody gets a :copy! 02:03
03:05 eroux left 03:06 eroux joined 04:57 squashable6 left, evalable6 left, linkable6 left, coverable6 left, sourceable6 left, statisfiable6 left, bloatable6 left, bisectable6 left, committable6 left, unicodable6 left, nativecallable6 left, statisfiable6 joined 04:58 committable6 joined, squashable6 joined, linkable6 joined, unicodable6 joined 04:59 sourceable6 joined, coverable6 joined, evalable6 joined, bisectable6 joined, nativecallable6 joined 05:00 bloatable6 joined 05:05 rba left 05:06 rba joined, nine left, nine joined 06:00 reportable6 left 06:02 reportable6 joined 06:23 discord-raku-bot left, discord-raku-bot joined 07:24 sena_kun joined 10:21 MasterDuke left 10:38 kueppo joined
kueppo Hello there! 10:41
I'm a learner and I'm reading moarvm source code as a reference so please excuse me if I mixing stuff and at the end they donot make sense at all, so here is my question.
What are the raku op extensions archive and where are they located in the generated bytecode after linking differents objects generated from the compilation of the different compilation units or it is that bytecode for every extension(say pick for arrays) fitted into different object before linking or it is loaded dynamically at runtime?
tellable6 2023-06-20T01:29:24Z #raku <guifa_> Kueppo63: you can check with .WHICH to see if you're getting the same actual array
lizmat kueppo: not sure what you mean by "extension" 10:43
but if you're talking about the .pick method on Array objects
that.s something MoarVM doesn't really know about afaik 10:44
kueppo yes, I donot see the opcode for that in moarvm code
but how come does it compile that if i may ask?
*interpret
lizmat because MoarVM is a VM for NQP, really 10:45
and Rakudo is built on NQP
kueppo From what I've read rakudo compile code to bytecode and Moarvm executes it right? also donot understand very well the relationship between NQP, Rakudo and MoarVM can you please explain? 10:47
lizmat NQP is the language in which Raku is implemented in the Raku compiler
NQP can have multiple backend, of which MoarVM is but one, and JVM is another 10:48
when you compile Raku code with Rakudo, it internally builds an AST in NQP, which is then converted to bytecode and then run 10:49
kueppo Okay, got it 10:50
lizmat the "core" of Raku, is mostly Raku code itself, with some NQP mixed in for bootstrapping and/or performance 10:51
but e.g. the .pick method on Array objects, is implemented in Raku
and is no different from any logic that you might implement yourself in Raku 10:52
(except maybe for performance tweaks)
10:56 kueppo left 11:00 kueppo joined 11:10 kueppo left 11:12 kueppo joined 11:20 kueppo left 11:21 kueppo left 11:25 kueppo joined 11:28 kueppo left, kueppo joined
kueppo (write code in raku + NQP) -> (build AST in) -> (compile AST to bytecode) -> (pass to MoarVM) -> (more MoarVM executes) 11:29
The above is what I understood based on your explanation, hope it is correct
Now since MoarVM has nothing to do with pick, grep, map etc, I'm don't understand how it is able to handle their instruction sets given that it is written in another language, `split` for example is an opcode but how `grep` works?
in what language is NQP written in?
Voldenet in nqp
kueppo: to grasp more, you might want to see `nqp` binary
kueppo ok, mind blown 11:30
Voldenet nqp is sort of like raku, but really limited
m: sub foo($x) { $x ~ "bar" }; my $x = ""; $x = foo($x); say $x 11:32
camelia bar
Voldenet valid perl code
nqp: sub foo($x) { $x ~ "bar" }; my $x = ""; $x = foo($x); say $x
camelia ===SORRY!=== Error while compiling <tmp>
Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " \"\"; $x = "
at NQP::src/HLL/Grammar.nqp:234 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:panic)
from <unknown>:1 (/home/…
Voldenet s/perl/raku/
but not valid nqp code
nqp: sub foo($x) { $x ~ "bar" }; my $x := ""; $x := foo($x); nqp::say($x)
camelia bar
11:33 kueppo90 joined 11:34 kueppo left
Voldenet to understand what's going on you want to start with github.com/Raku/nqp/blob/main/src/...nsMAST.nqp 11:34
iirc that connects to this file github.com/MoarVM/MoarVM/blob/main...core/ops.h 11:35
11:42 kueppo90 left 12:00 reportable6 left 12:01 reportable6 joined 12:41 sena_kun left, sena_kun joined
jnthn Things like `pick` and `grep` do get compiled into bytecode, if you have a Rakudo build tree look at blib/CORE.c.setting.moarvm (well, it's binary so `moar --dump blib/CORE.c.setting.moarvm` to get it disassembled) 13:09
Grep for `name : pick` in it or some such 13:10
13:49 jjatria left 13:50 jjatria joined 14:28 eroux left 15:29 squashable6 left 15:30 squashable6 joined 17:09 kueppo joined 17:25 kueppo left 18:00 reportable6 left 18:02 reportable6 joined 18:21 ingy left 18:29 kueppo joined 18:35 ingy joined 19:54 kueppo left 20:38 kueppo joined 20:47 sena_kun left 21:15 kueppo left