github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
08:22 domidumont joined 09:09 domidumont left 09:13 lizmat joined 09:19 patrickb joined 09:24 lizmat left 09:47 patrickb left 10:33 lizmat joined 10:57 lizmat left 11:41 lucasb joined 14:09 dogbert17 left 15:11 lucasb left
timotimo hm, now that the release has been skipped, should we merge some "merge after release" stuff, or is the next release too soon for that again? 15:30
MasterDuke any reason not to merge github.com/MoarVM/MoarVM/pull/1040 before my intifying branches? 15:52
16:17 Bastinkie joined, Bastinkie left 16:41 zakharyas joined 16:50 brrt joined
brrt \o 16:50
nwc10 o/ 17:06
brrt ohai nwc10 17:13
today, shall we be finally getting floating point support?
timotimo whoa
i can't handle the suspense
brrt well, neither can I 17:14
'will it compiel
*compile'
is the question
timotimo i hope so :) 17:17
brrt i bet I have a little more work to do before it is so 17:21
MasterDuke brrt: cool, that's what's needed before we can create all those *_n templates, right? 17:29
brrt yes
and matter of fact, I'll probably be doing that in your place
just to test that everything works as expected
timotimo m: BEGIN say $*LANG.^find_method("TOP").^methods 17:33
camelia {!set_name => The 'ForeignCode' class is a Rakudo-specific
implementation detail and has no serviceable parts inside, add_dispatchee => The 'ForeignCode' class is a Rakudo-specific
implementation detail and has no serviceable parts inside, clone =ā€¦
timotimo i'm looking to grab an NFA object from "userspace" in perl6 code 17:35
so i don't have to recompile rakudo to get stuff in the optimizer do stuff for me :)
MasterDuke brrt: nice 17:37
timotimo so it turns out in some random NFAs i see something like this: 17:39
27:
28 CODEPOINT S
13 CODEPOINT (
13 CODEPOINT [
13 CODEPOINT < 17:40
42 CODEPOINT <
13 CODEPOINT Ā«
13 CHARLIST {
i'm not entirely sure if charlist of one single char is less performant than a codepoint node, but surely having 5 codepoint entries would be less performant than having one charlist entry with all five chars in them? 17:41
it'll use MVM_string_index_of_grapheme 17:46
i wonder if we can get any improvement by sorting the graphemes by base codepoint for example
so we could in theory binary search 17:47
though tbh these strings are probably usually rather short
17:49 brrt left
timotimo also, of course combining codepoints mustn't go into a string for that optimization 17:52
MasterDuke timotimo: sounds like you've got some ideas 18:34
timotimo they could reduce the number of edges by a few, but i don't think the added overhead of that optimization will be made up by that change 18:35
MasterDuke ah, too bad 18:38
18:40 Ven`` joined
MasterDuke timotimo: in my last comment on rt.perl.org/Public/Bug/Display.html?id=128760 i mention logically redundant work. i don't remember what that is though, any idea? 18:42
timotimo colabti.org/irclogger/irclogger_lo...07-23#l106 - this gives a bit of info; it's that the same parts of the NFA get run through the optimizer multiple times 18:44
at least that's my interpretation
MasterDuke heh, was just looking there myself
how can we tell when we "re-compute the grammar for the very same postcircumfix" ? 18:46
timotimo that's the code in question having the same definition multiple times 18:48
all of them are for ā¦‹ ā¦Œ
MasterDuke so it should get cached somewhere after the first one is done and then get pulled from the cache subsequently? 18:49
is there already a mechanism where it checks a cache, and the cache is not being populated? or is any sort of caching at all not implemented? 18:51
timotimo hm
we'd be able to check if the exact same method already exists in the grammar and could just replace the implementation basically 18:52
MasterDuke is that the method my commit sped up the finding of? 18:53
(and wow, ^^^ is not a pretty sentence) 18:54
timotimo i don't think it is 18:56
but i haven't looked at the context
MasterDuke think that'd be done at a higher level than QRegex/NFA.nqp? 19:02
timotimo probably 19:05
but probably not in rakudo
perhaps in the base class for Grammar?
i'm not entirely sure where mixing in methods causes all the changes in the grammar
it could actually be part of rakudo, come to think of it
does nqp have custom operator declarations?
MasterDuke nqp: sub infix:<aa>($a, $b) { say($a ~ "||" ~ $b) }; say(4aa5); 19:08
camelia Confused at line 2, near "say(4aa5);"
at gen/moar/stage2/NQPHLL.nqp:811 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/NQPHLL.moarvm:panic)
from gen/moar/stage2/NQP.nqp:921 (/home/camelia/rakudo-m-inst-1/share/nqp/lib/nqp.moarvm:comp_unit)
from gen/moā€¦
MasterDuke guess not 19:09
timotimo then at least the part that kicks the mechanism off is in rakudo. actions or world?
MasterDuke i'm looking in both, but i don't even know what to search for 19:12
add_method? 19:14
timotimo aha 19:18
add_categorical in Grammar is a/the starting point
MasterDuke `# If we already have the required operator in the grammar, just return.` ? 19:19
in the example from the ticket, the category, opname, canname, and subname are all identical for each of the four times add_categorical is called 19:26
category = |postcircumfix| opname = |ā¦‹ ā¦Œ| canname = |postcircumfix:sym<ā¦‹ ā¦Œ>| subname = |postcircumfix:<ā¦‹
hm, how do i find the unique id of self in Grammar.nqp? 19:30
timotimo like self.WHERE?
probably more like nqp::getobjid or something 19:31
MasterDuke can't that change if a gc happens?
timotimo there's one op that causes an object to get a fixed ID
MasterDuke nqp::getobjsc? 19:33
huh, that just seems to return the empty string 19:34
19:35 vendethiel- joined 19:37 Ven`` left
MasterDuke ah. add_categorical is being called four times, but after the first it doesn't get past this: if nqp::can(self, $canname) { return 1; } 19:37
timotimo no, that's not it
ah it's just "objectid"
MasterDuke good to know. but regardless, it's got to be something other than add_categorical 19:38
timotimo hum 19:39
perhaps a stack trace from the point of the optimizer, for example 19:42
the nfa optimizer 19:43
MasterDuke the QRegex one? 19:44
timotimo yeah 19:45
MasterDuke huh, why do i keep getting 'Invalid cast.' when i try to `c MVM_dump_backtrace(tc)` 20:02
timotimo maybe you need call (int)MVM_dump_backtrace(tc)? 20:03
MasterDuke never needed to before 20:04
but still the sae
*same
ah 20:08
i was in cosh()'s frame
timotimo so there was no tc?
MasterDuke right
timotimo i thought that gives a different error message
MasterDuke well, something was off 20:09
timotimo *shrug* that's just gdb i guess?!
MasterDuke gist.github.com/MasterDuke17/b3d6e...68f9c1981f
multi_declarator? 20:10
routine_def is what calls add_categorical 20:14
20:20 domidumont joined 20:26 domidumont left 20:28 domidumont joined 20:31 domidumont left 21:04 brrt joined 21:14 zakharyas left
brrt I liked this blog: troubles.md/posts/why-do-we-need-th...thm-again/ 21:22
it's about how wasm is almost-but-not-quite awesome as an intermediate format 21:23
21:23 domidumont joined 21:25 domidumont left
timotimo i guess i'm glad we have a register machine 21:36
brrt well, me too 21:37
21:37 vendethiel- left
brrt also, I'm not sure I agree with the 'automatic SSA form' bit 21:37
most all stack machines I know have an escape hatch in the form of local variables 21:38
the JVM does
timotimo didn't it say that wasm has local variables too, which "is very slow"? 21:39
or is that an implementation detail for making some control flows work?
brrt nah, I'm confused by what he means with that 21:41
basically, what the author seems to want, is a single-pass compiler WASM that can offload all actual optimization to the frontend compiler 21:42
timotimo doesn't sound like an unreasonable desire, though
?
brrt no
It is quite reasonable I think 21:43
but it's difficult :-)
timotimo someone would like the implementors to be tortured :)
brrt well, I'll be happy to keep the torture to ourselves 21:45
timotimo how do you feel about merging stuff that was meant to be post-release because we skipped january? 21:47
i'm very much looking forward to having nqp default to ints
brrt hmm 21:49
why did we skip january?
and, what is going to go in? 21:50
timotimo because february is so soon already
brrt yes
timotimo well, for one we have the branch that switches nqp from using num for everything by default to using int for everything by default
also, i've put a little bit of code into spesh that'll turn some coerce calls into method calls that can actually be inlined immediately sometimes if i recall correctly 21:51
that's only really relevant for nqp code, though, since we don't use smrt_*ify in perl6 code to my knowledge
brrt it'll still help the compiler, I guess 21:52
timotimo yeah, one thing we intify and strify often is grammar/regex objects, which are of course match objects
brrt I.... am inclined to think that reverting is cheap 21:53
and we find more bugs if we move ahead
and aside from releases, which we kind of try to keep stable, we have no explicit expectations regarding dev versions
So I say, go for it
timotimo cool 21:54
the int-by-default branch is supposed to get a bit of cleanup i believe?
MasterDuke: ^?
brrt do we define 'NDEBUG' on our nondebug builds? 22:03
timotimo don't actually know
brrt we probably ought to 22:05
yay, the register-allocator-with-floating-point-support ocmpiles. Fairly sure it'll have a bunch of bugs 22:10
22:12 brrt left 22:23 sivoais joined
MasterDuke it may not be the cleanest set of commits, but i'll make NQP and Rakudo PRs by tomorrow evening 22:45
timotimo \o/ 22:46