Re:Parsing: the solved problem that isn't
by cturner on Tuesday March 15, 2011 @02:09PM
(#2328666)
What mature tooling is around for PEG investigation?
[ Parent
| on HN ]
PEG for Lua is pretty easy to use and experiment with: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
notably: lpeg uses backtracking over packrat parsing
Packrat parsing has fairly horrible memory usage. LPEG is amazingly frugal in terms of code size, run time, and memory usage.
It's worth noting that the PEG ordered choice operator leads to much more restricted backtracking than occurs in most regex implementations, so LPEG has much more predictable performance. And unlike a DFA matched you still get straightforward capture handling.