News for hackers. Stuff that matters.
Re:We Need to Know LR and Recursive Descent Parsing Techniques by 082349872349872 on Tuesday January 17, 2023 @06:26AM (#34411297)
The point of TFA is why reach for GLA, why even pay a cost for ambiguity, if you have control over the grammar, and can specify an unambiguous one to begin with?

IMNSHO we should be aware of "big hammer" solutions but not be afraid to pick concrete representations when they make things easy on the machine. (in particular, tests using the former are wonderful double checks for deployment candidates using the latter)

[when would specifying an unambiguous grammar be premature optimisation? when changing the language later is cheap (unlikely!), or when the strings in that language are always going to be of size <= k. Nerd snipe: what —to order of magnitude— is k ca. 2023?]

Re:We Need to Know LR and Recursive Descent Parsing Techniques by nine_k on Tuesday January 17, 2023 @06:36AM (#34411365)
Unambiguous grammars are easy not just to machines. Most importantly, they matter to humans. Reading something like Lua or Golang or SQL is usually much easier than C++, to say nothing of Perl.
Re:We Need to Know LR and Recursive Descent Parsing Techniques by sshine on Tuesday January 17, 2023 @06:53AM (#34411443)
> we should be aware of "big hammer" solutions

Parser combinators have become my preferred "medium hammer" strategy:

Sometimes you get a more readable parser than if you use regex, even though your language is regular.

Sometimes you get corner cases where you have to think and an LR parser generator wouldn't require thinking.

On the other hand, you have one tool that almost always does the job well, is readable, and embeds nicely.