Context free grammars (CFG) are better than parsing expression grammars (PEG), because CFGs represent how we think.

Parser combinators are similar to PEGs, so they are worse than CFGs, too.

So, don't use Rust libraries nom, combine. Use lalrpop.

Don't use Haskell libraries parsec, gigaparsec, attoparsec, megaparsec, trifecta. Use Earley, happy.

See more detailed story in my new article https://safinaskar.writeas.com/this-is-why-you-should-never-use-parser-combinators-and-peg .

The story also includes some cases, where PEG and parser combinators may still be useful. Also, the article gives links to my Haskell parsing libraries.

#haskell #rust #parsing #parse #cfg #peg #combinators #parsercombinators #parsingcombinators #nom #combine #lalrpop #parsec #earley #happy

This is why you should never use parser combinators and PEG

Let me tell you why you should (nearly) never use PEG (parsing expression grammars). Nearly everything I will say applies to parser combi...

Askar Safin