Dreaming of a Parser Generator for Language Design
This is an excellent survey of many of the issues facing modern parsers.<p>They correctly point out that error handling is by far the biggest one, and usually ends up being the biggest part of a parser for a language, full of crufts and strange mixtures of semantics and syntax.  Add to this that you frequently want to try to partially recover -- make a guess as to what was intended and continue parsing in the hopes of finding more actionable errors later in the code.<p>I do disagree with a lot of the other conclusions, especially operator precedence, which I&#x27;ve come to believe is generally a bad thing -- associativity can be fine (although even there I&#x27;m uncertain), but managing operator precedence is almost always better done by using parentheses.<p>I like scannerless, but the author makes a lot of good points that I might have to rethink.  The analogy to how people read makes some sense, but I&#x27;m not sure there&#x27;s as crisp a line between syntax and semantics as that analogy would imply in natural languages.<p>Around ambiguity and grammar constraints, I think in the end it&#x27;s something you have to live with; a complex language with ambiguities or left-recursion is hard for both a machine to parse and for a human to parse, and should be avoided.  This also relates to error handling, and, to some degree, error recovery, which is a very nice feature in a language grammar that allows you to generate some AST information (for the purposes of syntax highlighting or LSP features) even on incomplete or partially truncated code.  Here I feel that there&#x27;s a lot of room for languages to include assertions that serve &quot;no value&quot;, like semicolon line endings -- one frustration often expressed by the anti-semicolon people is &quot;the compiler can tell me when a semicolon is missing, let&#x27;s just have the compiler put them in&quot;.  I feel that this is misguided and interferes with the ideas of being able to continue parsing code with errors in it.