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:06 reportable6 left 00:09 reportable6 joined 02:51 Kaipei left 03:16 frost joined 04:10 Kaiepi joined 05:35 bloatable6 left, nativecallable6 left, releasable6 left, notable6 left, sourceable6 left, unicodable6 left, benchable6 left, reportable6 left, evalable6 left, quotable6 left, linkable6 left, statisfiable6 left, shareable6 left, tellable6 left, bisectable6 left, coverable6 left, committable6 left, greppable6 left 05:36 unicodable6 joined, evalable6 joined, releasable6 joined, benchable6 joined, reportable6 joined 05:37 sourceable6 joined, linkable6 joined, nativecallable6 joined, shareable6 joined, coverable6 joined, tellable6 joined 05:38 committable6 joined, bloatable6 joined, bisectable6 joined, notable6 joined, quotable6 joined 05:39 greppable6 joined, statisfiable6 joined
Nicholas [* GOOD *] 06:02
06:06 reportable6 left 06:08 reportable6 joined 08:21 sena_kun joined
jnthnwrthngtn moarning o/ 09:26
Nicholas \o 09:30
10:08 evalable6 left, linkable6 left, evalable6 joined 10:11 linkable6 joined 11:34 evalable6 left, linkable6 left 11:35 Altai-man joined, evalable6 joined 11:36 linkable6 joined 11:38 sena_kun left 12:08 reportable6 left 12:09 reportable6 joined
japhb o/ 12:42
nine Signature declarations a bit of a tricky beast. On the one hand we get quite a bit already for free (like declarations) by utilizing RakuAST::Signature. On the other hand it's hard to find a good place for creating containers for those parameter targets. 12:45
jnthnwrthngtn nine: I already have local work on those 12:52
nine: But it's another of the things that triggered my "need to figure out the timing issues" detour 12:53
gist.github.com/jnthn/420e93cd4ca0...92c10fb361 is the notes so far, fwiw
nine Aaaah...that background explains why timing is such a big issue. Didn't find it that difficult so far and most things found a reasonable place. But of course I totally ignored that we want to add macros and custom compiler passes :) 12:55
In github.com/rakudo/rakudo/commit/f5...cb61fdf1c5 I figured that an optimization pass would want to have the generated block for where expressions already in place, so I generate them at BEGIN time 12:56
jnthnwrthngtn There's some things I'm struggling to decide where go, alas. Like the implicit block semantics. 12:59
nine Like those where blocks I mentioned? 13:08
13:10 Kaiepi left
jnthnwrthngtn No, the thing that makes the block of a `with` get declared with an implicit topic parameter, or the block of a `start` having a fresh $/ and $! 13:11
Because they're not really about the block, but about its "owner"
13:11 Kaiepi joined
nine Ah, part of the "Some nodes need to know about surrounding context in order to compile" problem 13:13
.oO(It would be soo useful to have a $!parent in each node, and sooo lead to bad design)
13:16
jnthnwrthngtn: wanna share what you have on signature declarations? 13:20
jnthnwrthngtn nine: Wasn't much; branch stub-var-sig-decl 13:27
nine - my \type = ::($.typename); 13:31
+ my \type = try ::($.typename);
Aaaah...yes, that one :D 13:32
Ok, looks like my RakuAST::VarDeclaration::Signature is already way more advanced. And I picked the exact same name :)
jnthnwrthngtn Well, then continue with yours I guess :) 13:39
nine thinks it's about time to factor out the code for creating containers 13:44
jnthnwrthngtn Yeah, I'd figured signature vars would imply that, but was undecided where it goes :) 13:45
nine RakuAST::ContainerCreator? 13:46
method IMPL-CONTAINER can easily go into a role. It only expects .sigil and .twigil on self
jnthnwrthngtn Hm, not also type? 13:50
nine $of is supplied by the caller 13:51
Plan is to add a $!container-type to RakuAST::ParameterTarget::Var, set by RakuAST::VarDeclaration::Simple and used to determine whether to create a contvar and if with what container type 13:52
s/
s/RakuAST::VarDeclaration::Simple/RakuAST::VarDeclaration::Signature/
14:18 frost left
nine nine@sphinx:~/rakudo (rakuast_wip *<>)> ./rakudo-m -e 'my ($a, $b) = 1, 2; say $b;' 14:34
2
nine@sphinx:~/rakudo (rakuast_wip *<>)> ./rakudo-m -e 'my Int ($a, $b) = 1, 2; say $b;'
2
nine@sphinx:~/rakudo (rakuast_wip *<>)> ./rakudo-m -e 'my Str ($a, $b) = 1, 2; say $b;'
Type check failed in assignment to $a; expected Str but got Int (1)
japhb nine++ 14:44
15:42 Techcable_ joined 15:45 rypervenche_ joined, jnthn joined 15:49 AlexDaniel left, uzl[m] left, Techcable left, rypervenche left 15:50 jnthnwrthngtn left, Techcable_ is now known as Techcable 15:58 uzl[m] joined 16:00 AlexDaniel joined 16:53 Kaiepi left 16:54 Kaiepi joined 18:08 reportable6 left 18:10 reportable6 joined
nine m: class Foo { has Int ($.a, $.b) is default(1); }; say Foo.new.b # Implementing a compiler for a language teaches you quite a lot about that language... 18:19
camelia 1
18:48 MasterDuke left
nine And another 10 spec test files unlocked. Now 414 passing 18:59
19:01 MasterDuke joined
nine Now there's only 1 rakuast_wip commit left to merge, before the rakuast branch can compile a (somewhat) usable Test.rakumod. It brings a bit of support for nqp ops 19:02
The hardest part of that is that for nqp ops literals need to be unboxed, i.e. need different code gen for those. 19:05
Again a "Some nodes need to know about surrounding context in order to compile" problem
19:28 Kaiepi left 19:51 Kaiepi joined
japhb nine: ISTR that's done in the current compiler by having literal nodes know both their boxed and unboxed forms, and the parent gets to pick ...? 19:59
20:31 Altai-man left 20:40 sena_kun joined
MasterDuke interesting. adding that pretty simple fast path in MVM_string_utf8_encode_substr takes `my $a = "when.opt".IO.slurp; my $b; my $s = now; $b = $a.encode for ^100_000; say now - $s; say $b.decode.chars` from 4.2s down to 2.0s 21:42
where 'when.opt' is 18kb, 350 lines, and 18101 chars 21:44
`MVM_SPESH_BLOCKING=1 ./rakudo-m -e 'use nqp; my $a = "src/core.c/Int.pm6".IO.slurp; my $b; my $s = now; $b := nqp::sha1($a) for ^10_000; say now - $s; say $b' now is ~0.38s (~0.58s on master, ~0.22s with the binarysha1 op) 21:51
hm. only gets hit 1k times when compiling CORE.c 21:54
right, because most of the strings used then are strands 21:58
japhb Good progress, definitely 21:59
MasterDuke trying to remember what the other benchmarks i ran where i saw MVM_string_utf8_encode_substr a lot...
hm. i wonder if there's some heuristic where it would make sense not to make strands when concatenating a string and a newline? 22:03
22:17 discord-raku-bot left 22:18 discord-raku-bot joined