2 Combinator libraries replace tools

Why would we want to use parsing combinators when we could instead use a parser generator tool? A parser generator like Yacc [Joh75] comes with a special programming language suitable for the task of specifying parsers. Although this is a quite powerful tool, it comes with a price, in that we have to learn this new programming language. Other tools (for example for specifying graphical user interfaces), also come with their own, domain-specific programming languages. Although they are often superb in many cases, they all have in common that the programmer must learn a quite new syntax, and often, the possibilities for the programmer to form new abstractions are poor. In the case of Yacc, it is not possible to express the abstraction withinParentheses, for example. It is also hard or impossible to share abstractions between the different tool languages and the programmer's general programming language, something which adds to the overall complexity of a software system.

To return to our example, parsing combinators allow us to smoothly integrate parsers in our software without any additional tools, languages or compilers. We only need a library for parsing combinators. More generally, combinator libraries can be seen as defining an embedded language inside our general programming language. This way, the number of concepts a programmer has to learn decreases drastically, since the general programming language's idioms apply directly.

However, it should be noted that combinator libraries often miss features that specialised tools have (like efficiency). It is a challenge for creators of combinator libraries to catch up with this.