Hacker News new | past | comments | ask | show | jobs | submit login

What do you mean by "in the wild"? I would have thought it was the opposite. Handwritten recursive descent is the way to build a parser if most compiler projects are to go by. OpenJDK, GCC, Clang, Rust, Spidermonkey are examples. Occasionally you see a generated lexer but generated parsers seem to be a rarity in practice while recursive descent is ubiquitous.



Most SQL systems (postgres, mysql, sqlite) use generated parsers but yeah other than that handwritten is the norm.

Is there a reason for that? None that I can think of. SQL systems tend to have worse error messages but I don't believe parser generators require error messages to be as bad as SQL error messages (I'm talking about how they often don't give line number or column number info).

So my guess (and it sounds kind of absurd to say) is that most SQL systems just don't put much thought into parsing. And not that parser generators fit the domain better.


In my case, I have not had occasion to write compilers and parsers. I've used parsers that others have written, frequently.

But, like I said, the idea behind it was quite useful, to me. I use recursion all the time, and RDPs are a pretty "pure" form of recursion.


Yes I agree. There is something quite elegant and fundamental about recursive descent parsing.


For quickly writing a parser that doesn't necessarily have to have the highest performance, parser generator libraries are another neat possibility beyond rolling your own parser from scratch or using a generator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: