The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
NFA: Lexed in 0.713062 msec
*NFA+DFA (optimized): Lexed in 0.491195 msec
*DFA: Lexed in 0.493133 msec
NFA (raw): Lexed in 1.516519 msec
DFA (raw): Lexed in 0.147636 msec
I think this is interesting in that all but the (raw) are powered by my Pike VM, but the two Raw runs are just implemented using straight finite automata
The raw DFA is of course the fastest by far, but what's interesting about it is this is a special case of the raw NFA algorithm. However, the raw NFA algorithm is much slower than the pike vm! For the DFAs it's the opposite, because of the overhead of running a pike VM, but the pike VM does NFA very efficiently. That's a really interesting property of it.
I might be able to take advantage of that to create some kind of NFA based workflow engine powered by a pike VM
* same lexer program - the NFA+DFA optimized is pure DFA in this instance
So my little Pike VM based lexer[^] now generates ideal code. The optimization took me over a week but this is so cool.
I found out that each machine program that is not optimized has i think one ideal optimized program, and because of the way the bytecode works it's very hard (if not impossible) to make two programs match the same language.
I just can't get over how cool this endeavor was. Super satisfying.
It's a "real" compiler, with a "real" optimization phase, only for regex instead of sourcecode.
I've never made one before. It was neat. Now I'm not sure what to do next.
well what comes after lexing?
compilation, [optimisation] code gen, [optimisation] linking [optimisation].
back to work.
after many otherwise intelligent sounding suggestions that achieved nothing the nice folks at Technet said the only solution was to low level format my hard disk then reinstall my signature. Sadly, this still didn't fix the issue!