2 ms·
> I don't understand why so many people glorify hand-written parsers. [...] I would say because they make the easy things easier, but the hard things harder.
by zeptomu 10y ago
> I don't understand why so many people glorify hand-written parsers. [...]
I would say because they make the easy things easier, but the hard things harder.
If one tries to do something more elaborated, like getting a data structure for the AST (most tutorials just build simple "accepters" which I find unacceptable) and passing it to different functions - which is a standard procedure in an interpreter or compiler - things are not so trivial anymore and you need to know your generator really well and hope that your use case is supported.
Another approach are parser generators like you find in functional languages, and I really like them, as you do not have to learn an additional language and they compose incredible well. They can blow-up your memory requirements but this is another story.