3 ms·
At the risk of sounding inflammatory, what would be the point of using a parser generator over a powerful applicative-style combinator library like https://gith
by nonsince 10y ago
At the risk of sounding inflammatory, what would be the point of using a parser generator over a powerful applicative-style combinator library like https://github.com/Marwes/combine https://github.com/Marwes/combine ? I've used both in the past and personally massively prefer parser combinators, but I'd be interested to know what the benefits are of parser generators.
- z681781 10y agoI cannot answer that directly, since I've never used parser combinators. The general problem is that there's so much software out there to learn that most people are happy when they know yacc-style and antlr parser generators. Also, most people are regularly disappointed by software that over-promises, which costs them a lot of time. So they stick to what works for them. In my case, I find Bison/Menhir such great tools that I have zero inclination to even look at other things. EDIT: A corollary to this is that people who are very productive (Thompson, Torvalds, Bellard,...) don't constantly change their software stacks.
- Matthias247 10y agoI think one advantage of things like ANTLR is that the grammer is described in an abstract fashion and that you can then generate parsers in multiple target languages with it. With a parser combinator library you are only targeting a single language. I also think that for project outsiders and beginners it's easier to look at and understand a grammar instead of a parser in combinator style. I personally have worked with parser generators (Irony for .NET) as well as parser combinator (fparsec) and enjoyed both a lot.