3 ms·
> They force you to write a declarative grammar which a human can understand. The problem is many languages' grammars are not declarative. They're full of comp
by chrisseaton 7y ago
> They force you to write a declarative grammar which a human can understand.
The problem is many languages' grammars are not declarative. They're full of completely uncontrolled side effects. So why are we trying to use a declarative tool for them? It's the wrong tool for the job.
- hasbot 7y agoHow is that relevant to this thread in which I am saying that the parsing/lexing as described in the link is very outdated? Maybe you should start a separate discussion.
- chrisseaton 7y ago> Maybe you should start a separate discussion. I started this one!
- judofyr 7y ago> It's the wrong tool for the job. Yes! We should have both handwritten parsers and parser generators in our toolkit and then depending on the language we want to parse we should choose the best tool for the job. My point about a declarative grammar was more that if the language permits it (e.g. is simple enough for Bison), it's so valuable to have a declarative grammar which serves as both specification and parser. It will be way less bug-prone than any handwritten parser. (From my experience handwritten parsers tends to have both weird crashes and unexpected handling of edge cases. But maybe I just suck at programming?) I've seen people using Bison on one complicated languages, given up, and then they bring the negative bias to other languages they want to parse — even when the other languages are very simple.