2 ms·
I kind of really dislike the tendency to conflate PEG and packrat parsing. Packrat parsing is not a required feature of PEGs, and many of them don't use it. Fu
by stormbrew 12y ago
I kind of really dislike the tendency to conflate PEG and packrat parsing. Packrat parsing is not a required feature of PEGs, and many of them don't use it.
Further, many implementations of packrat parsing are absolutely dog slow because they simply memoize every term, which is basically trading a high complexity in steps for a high complexity in space, so allocation pressure and cache pressure can both become very bad, especially for large inputs and/or large grammars. To me it's almost a defining case of complexity notation being utterly misleading in practice.
This paper reflects my experience: https://mercurylang.org/documentation/papers/packrat.pdf https://mercurylang.org/documentation/papers/packrat.pdf