Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
00:00 lizmat joined
MasterDuke .ask jnthn if you've got some spare time, any thoughts on github.com/perl6/nqp/pull/518 and github.com/rakudo/rakudo/pull/2670 ? 00:44
yoleaux MasterDuke: I'll pass your message to jnthn.
Geth rakudo: 31e534cf4d | (Daniel Green)++ | src/Perl6/Compiler.nqp
Update help text for reworked profiling options
00:47
01:21 AlexDaniel joined 04:37 nacyro joined 05:13 vrurg left, AlexDaniel left 06:11 nacyro left 06:35 ufobat joined 06:36 lizmat left 07:43 AlexDaniel joined 07:50 lizmat joined 07:54 robertle left 07:55 robertle joined
lizmat . 08:06
yoleaux 18 May 2019 11:33Z <sena_kun> lizmat: thanks for merging! reminding that github.com/perl6/nqp/pull/540 should be merged too, for github.com/rakudo/rakudo/pull/2907 to pass all tests. :)
08:47 lizmat left
[Tux] Rakudo version 2019.03.1-409-g31e534cf4 - MoarVM version 2019.05-11-g248e2980a
csv-ip5xs0.709 - 0.716
csv-ip5xs-205.948 - 6.008
csv-parser21.747 - 21.762
csv-test-xs-200.425 - 0.448
test7.618 - 7.852
test-t1.701 - 1.794
test-t --race0.783 - 0.810
test-t-2027.908 - 28.385
test-t-20 --race9.517 - 9.856
08:49
12:10 dogbert11 joined 12:13 dogbert17 left, brrt joined 12:35 ufobat left 13:06 brrt left 13:40 brrt joined
Kaiepi AH HAH 13:58
bastille% ./perl6 test.p6
Feed: avg. 0.0003595710510049321
Method: avg. 0.001721516886617255
No ops: avg. 0.0022695014322236338
I FIGURED OUT HOW TO MAKE PARALLELIZED FEED OPERATORS RUN FAST 13:59
timotimo ooooh
hey, you don't happen to know stuff about C macros? :)
Kaiepi a little 14:00
timotimo cool. let me bounce this off of you
i turned all instances of (MVMVeryLongTypeName *)MVM_malloc(formula * sizeof(MVMVeryLongTypeName)); into MVM_MALLOCOBJ(formula, MVMVeryLongTypeName);
in the hopes of being able to put a DTrace point into MVM_MALLOCOBJ that has the type name as a string 14:01
brrt but why have the cast to (MVMVeryLongTypeName * ) at all, we're not compiling C++?
timotimo i don't know how to properly make the macro expand to something that first has a DTRACE_PROBE2(...); and then the MVM_malloc(...);
brrt: *shrug*, it was there in some places, but not in all of them
Kaiepi i've never used dtrace before 14:02
timotimo i don't think that's important 14:03
the problem comes from gcc complaining that there has to be an expression before "do", which seems to be part of the DTRACE_PROBE2 macro. i assume it does the do { ... } while (0) thing
actually, perhaps i am actually forced to put the dtrace probe in just one spot 14:04
so it'll have to be inside a function, rather than inside the macro expansion
brrt I don't think there can be an expression before do 14:05
int x = do { ... } while (0); is valid perl maybe, not C
idk
brrt afk
14:05 brrt left
timotimo now all i need to figure out is how to get a string from the type_name 14:08
ah, it's just #type_name 14:11
Kaiepi what is the purpose of WANTED in Perl6::Actions? 14:53
timotimo that powers the "useless use of blah in void context" stuff 14:55
Kaiepi i'm not sure what you mean 14:59
like "useless use of x in sink context"?
b2gills m: 1; 15:00
camelia WARNINGS for <tmp>:
Useless use of constant integer 1 in sink context (line 1)
b2gills The 1 above is not WANTED
Kaiepi ahh 15:08
ok
i don't need to worry about it for the feed operators pullreq then, i already have everything that's supposed to be wanted wanted 15:09
15:55 ufobat joined
ugexe $output := $output.cache -- Kaiepi: should this be automatic, or should the user have to apply eager/cache themselves? 16:33
i can't think of a good reason for it *not* to be automatic, but i feel like there is probably a reason none-the-less (even if its not very good) 16:35
Kaiepi the spec mentions something about eager, lemme check 16:36
ugexe my @squares <== eager map { $_ ** 2 } <== 1...*; vs my @squares <== map { $_ ** 2 } <== 1...*; 16:40
Kaiepi looks like this needs more work, it's failing S03-feeds/basic.t 16:56
17:10 evalable6 left 17:11 evalable6 joined, ChanServ sets mode: +v evalable6 17:25 ggoebel joined 17:58 ggoebel left 18:25 vrurg joined
nine Turning the SQL BNF grammar into an SQL parser for Perl 6 runs into surprising issues. Like bugs in the actual BNF grammar or that rakudo scales terribly when compiling simple but large grammars and 32 GiB of RAM are just not enough... 18:46
ugexe does BNF have anything that translate to |? I thought they only did || 18:48
timotimo holy ... 18:53
nine Note that Grammar::ABNF actually creates a Grammar object and succeeds by compiling each token individually and stiching them together. That's also pretty fast. 18:55
timotimo that memory usage though 18:57
any clue what does that?
nine none 18:58
timotimo well, there's this tool i'm supposed to be working on 18:59
just a few layers of yaks on top of it at the moment
nine Splitting the grammar into a couple of roles makes it compile pretty fast
timotimo oh
i wonder if every time you add a single thing it'll recalculate and reoptimize all the NFAs
nine Definitely feels like O(n^2). I'm pretty sure it's no individual part of the grammar 19:00
Oh, apparently I did something wrong in my earlier test. Splitting it doesn't actually help. Even the empty grammar that just does the roles with the individual parts compiles forever 19:07
MasterDuke that's something i'd tried to start on (and even the little ways i got required extensive hand-holding from jnthn++), but was making such slow process i got distracted by other stuff
timotimo nine: you could get a "sampling profile" from the program by just sending ctrl-c to the program at regular intervals and calling MVM_dump_backtrace(tc) inside of gdb :) 19:11
nine timotimo: always looks like gist.github.com/niner/b21b7691ade0...5cb496a165 19:20
timotimo wow, ouch
that's pretty deep 19:21
nine Why does it work with the stiched together tokens? 19:25
timotimo how do you mean? 19:26
nine github.com/tadzik/Grammar-BNF/blob...NF.pm#L257 19:27
Btw speaking of suprising issues: did I mention that Grammar::ABNF only succeeds in parsing the BNF if Grammar::Tracer is included? 19:28
timotimo oh no
19:43 brrt joined
nine I wonder if there is any way for me to continue if rakudo is just not good enough for compiling deeply nested grammars? 19:45
timotimo i'd be interested to see what these NFAs look like that it's trying to merge there
clearly things are kind of deeply nested? maybe? 19:46
perhaps you need to terminate some declarative prefixes early :)
nine timotimo: github.com/niner/SQL-Grammar/blob/...erated.pl6 19:48
timotimo that is pretty big, but nothing compared to the perl6 grammar
token window_frame_exclusion { 'EXCLUDE' 'CURRENT' 'ROW' | 'EXCLUDE' 'GROUP' | 'EXCLUDE' 'TIES' | 'EXCLUDE' 'NO' 'OTHERS' } 19:49
that seems wrong :D
no spaces allowed in between
but that's for another time
ugexe change all the | to ||
brrt nine: there's more than one possible SQL grammar...
nine ugexe: then it parses in seconds! But...why? 19:57
ugexe because BNF was not written to try and parse every alterations and find the longest match. it is ordered
timotimo because | isn't supported in the NFA
so no nfa will be built 19:58
otherwise if you only have | you'll be getting one NFA spanning the entire grammar
and of course every token will also have its own little subset of the whole, but basically a copy of it 19:59
nine Of course, it doesn't yet finish parsing even the simplest of statements. Probably because of white space treatment 20:05
timotimo yeah 20:06
just remove all whitespace from the input before parsing :D
nine And because the BNF makes no distinction between * and + repetition. Using * everywhere makes it match too often
20:09 ufobat_ joined, brrt left 20:13 ufobat left
nine How can I dump the string to be matched in a grammar rule? 20:24
ugexe `<foo> {say $/}`? 20:25
n/m, the string to be matched against, not the match 20:26
timotimo that'd be $/.orig 20:28
or .target
nine .orig and .target seem to be the whole string 20:31
substr($/.target, $/.pos) is what I'm after 20:32
So why would "customers" not match "\w"? 20:33
Ah, it must be token identifier_start not rule 20:35
Success! 20:38
timotimo why not .Str? 20:44
oh, you're looking for starting at $/.pos to the end
20:50 brrt joined
Kaiepi ok i'm having another problem with qast 21:10
how do i get the compile-time value of a variable from another statement? 21:11
like with "my @a = 1,2,3; @a ==> map { $_ ** 2 } ==> my @b;" i want to get value assigned to @a in the first statement from the second one 21:12
from what i've tried so far all i can manage to get is an empty array
timotimo oof 21:14
you can get that at the earliest in the optimizer i think
what do you need it for? 21:15
Kaiepi i need it to pass to RI.EVALUATE-FEED 21:18
timotimo you want to get Array.new(1, 2, 3)? 21:20
m: my @a = 1, 2, 3; say "using @a[]"; sub infix:<,>($a, $b) { say "lol nope" } 21:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling infix:<,>(Int, Int, Int) will never work with declared signature ($a, $b)
at <tmp>:1
------> 3my @a = 1, 27⏏5, 3; say "using @a[]"; sub infix:<,>($a,
timotimo m: my @a = 1, 2, 3; say "using @a[]"; sub infix:<,>(*@a) { say "lol nope" }
camelia lol nope
using True
timotimo Kaiepi: ^- this will frustrate your attempt to get the data before the optimizer stage
Kaiepi argh 21:24
21:35 brrt left 21:39 lizmat joined 22:57 vrurg left, gfldex left 22:58 gfldex joined