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.
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2025/03/03/2025-...ting-down/ 12:57
timo once again i am confused by the internal structure of NFAs 17:18
lizmat do we have docs on that ? 17:21
timo never mind, I was just Doing Pointers Wrong
lizmat heh... there was a time when that acronym was used a lot 17:22
timo i once had a commit that turned "charlist" edges with just a single character into a "codepoint" edge, that would also come in handy for what i'm currently looking at 17:28
right now i'm seeing if i can make a fast path for when the NFA would immediately return "no match" and compile that into the code 17:29
unclear if that's a win or not 17:31
"nfa engine startup" is not really an expensive "operation", and the fast check would always have to happen and can't really take work away from the real engine
the fast check can actually be a bunch simpler than a full nfa run, as it doesn't have to care about fates at all, and therefore the acceptable characters from all targets can be collapsed into a short list of deduplicated characters 17:42
for example, the NFA for "proto token term" gives me 259 lines of output for "interesting edges" for the first character; subtract 43 from that for synthetic edges and epsilons, then when i deduplicate all codepoint and codepoint longlit together i'm down to 66 unique codepoints, two character classes, and four charlists that i haven't looked at yet 17:51
the charlists expand to 9 characters 17:52
and they are all already there as codepoint edges, too 17:54
ok, this particular example has char classes 4 and 8 which are "alphabetic" and "numeric" respectively, which covers a quite wide variety of stuff 17:57