3 ms·
They can be as fast as hand written recursive descent parsers, which is what they are under the hood anyway. But of course this way of writing parsers is like
by zzzcpan 8y ago
They can be as fast as hand written recursive descent parsers, which is what they are under the hood anyway.
But of course this way of writing parsers is like compiling without optimization passes. It can be fast for a lot of things, but not as fast if you can do some optimizations, like moving shared prefixes out of strings to match them only once or use lookup tables instead of iterating over a lot of choices, etc. It requires generating an AST with combinators, not parsing functions directly. Which nullifies the whole point of using parser combinators in the first place.