2 ms·
While I certainly understand the desire to hand-write parsers, I think people often underestimate how useful it can be to have an explicit grammar for your lang
by Sean1708 8y ago
While I certainly understand the desire to hand-write parsers, I think people often underestimate how useful it can be to have an explicit grammar for your language (even if you hand-write the parser then just fuzz test it against the grammar or something like that). It can help so much with external tooling, and you can often analyse explicit grammars in ways you could never analyse a hand-written parser.
As a concrete example, I recently had to write a parser for i3 config files and trying to figure out what was and wasn't syntactically valid was so horrendous that I ended up just hacking together some half-arsed thing just about works for the one or two files I tested it but that I'm fairly sure is going to break horrendously at some point.