4 ms·
I also went to university, where they also over-focused on lex and yacc and similar. However, most people who work on parsers where the user or developer experi
by ghusbands 4y ago
I also went to university, where they also over-focused on lex and yacc and similar. However, most people who work on parsers where the user or developer experience matters don't use them, because they are quite restrictive and cumbersome and typically don't give nice error messages.
Academia doesn't necessarily teach you the most useful way to do things.
- kubb 4y agoWould you painstaikingly handcraft a recursive descent parser because the generator doesn't give you nice error messages?
- ghusbands 4y agoThat's a fairly normal approach, yes [1]. It's not so painstaking. There are parser generators other than lex and yacc that do a better job, but making most generators produce good errors and handle your context-sensitive tokenisation is more effort overall than making an equivalent hand-written parser (be it near-Pratt, PEG, general recursive descent or anything else). [1] https://notes.eatonphil.com/parser-generators-vs-handwritten-parsers-survey-2021.html https://notes.eatonphil.com/parser-generators-vs-handwritten...