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 good *, * 06:44
MasterDuke jnthnwrthngtn: are "Make the AST compiler support return types..." and "Make us indicate slurpiness when signatures are introspected." listed here github.com/rakudo/rakudo/tree/raku...nt-to-help actually done? 12:16
i see stuff related to return types and slurpiness in github.com/rakudo/rakudo/blob/raku...re.rakumod 12:17
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/04/11/2022-15-wordling/ 12:30
jnthnwrthngtn MasterDuke: Those relate to the thing that compiles the stuff under src/Raku/ast into the NQP code that goes into the bootstrap 12:37
So one can introspect the RakuAST API itself via the MOP (and thus IDEs can auto-complete on AST node types, etc.)
MasterDuke: So, it's in github.com/rakudo/rakudo/blob/raku...mpiler.nqp 12:38
nine After you've written your first one, compilers seem to be the solution for every problem 13:00
MasterDuke ah 13:01
jnthnwrthngtn Why write code when you could instead write code that writes the code? :) 13:03
Nicholas there's no problem that can't be made better with anohter level of abstraction 13:05
jnthnwrthngtn Today's little RakuAST bit from me netted some new passes. Up to 381 fully passing now. 21:28
MasterDuke am i correct in thinking that we don't have any built-in way of directly getting the parts (significand and exponent) of a num? 21:36
jnthnwrthngtn I'm not aware of anything more than writing the num into a Buf with `write-num64` and then pulling the appropriate bits out. 21:43
Probably would need to account for denormals too 21:44
MasterDuke i was thinking about www.reddit.com/r/rakulang/comments...f_feature/ and wondering if there was any additional smarts that could be added to Num's Rat method 21:48
but i haven't been able to come up with anything. since at the point of calling .Rat, we just have a plain num/float, not the literal form with the parts nicely broken out 21:49
SmokeMachine Do we already have a way of creating new compiler custom passes using RakuAST? 22:09
lizmat SmokeMachine: to my understanding: not yet 22:20
SmokeMachine Thanks lizmat 22:21
lizmat MasterDuke: looking forward to further review 23:08
calling it a day now
MasterDuke maybe the slowdown was using the `if foo() -> $bar {` construct, which is slower than explicitly doing the assignment before the `if` 23:13
nqp: my %h := nqp::hash("a", 1, "n", 2, "f", 3, "v", 4, "g", 5, "e", 6, "k", 7, "o", 8, "c", 9, "x", 10); my $a; my int $i := 0; my int $s := nqp::time; while $i++ < 100_000_000 { if nqp::elems(%h) -> $e { $a := $e + 1 }; }; say(nqp::div_n(nqp::time - $s, 1000000000e0)); say($a) 23:15
camelia 1.449024658
11
MasterDuke nqp: my %h := nqp::hash("a", 1, "n", 2, "f", 3, "v", 4, "g", 5, "e", 6, "k", 7, "o", 8, "c", 9, "x", 10); my $a; my int $i := 0; my int $s := nqp::time; while $i++ < 100_000_000 { my $e := nqp::elems(%h); if $e { $a := $e + 1 }; }; say(nqp::div_n(nqp::time - $s, 1000000000e0)); say($a) 23:16
camelia 0.972030957
11