New week, new Rust! What are you folks up to?
Still going with parse-bolt. And I have something rather exciting. Its becoming a parser combinator library that compiles down into an LR(1) parser.
In the grammar this means:
- Direct left recursion -> No problems
- Indirect left recursion -> No problems
- It is deterministic -> linear time complexity with length of input. No backtracking is performed (or required) and it feed just 1 token at a time. (Blazing fast!)
It is currently done via parser3.rs while I am experimenting:
Soon I'll make it the default.
There is one optimization I need to do for the parser that gets generated. Currently it processes the result though a value stack of type Vec<Box<dyn Any>>
. But if I instead use Vec<u8>
and cast raw pointers into and out of the value stack, then I can match the speed of carefully crafted hand written parsers and parser generators.
Working on refactoring samsara, the proc macro that generates types describing paths in a finite state machine, to move its logic outside of one huge function.