I'm trying to finally learn parsing properly. I run into a lot of little problems in my day job and have a lot of ideas for side-projects that I think would be served by having a better handle on it. So I'm creating toy languages and writing toy parsers for them.
One reason I'm targeting parsers in particular is because I've been finding a lot of modern programming language books are a bit anti-parsing these days. EOPL avoids parsing altogether by using a parser generator, effectively saying that it's a hard problem. PLAI outright calls parsing a "distraction". SICP (not strictly a compiler book, I know) and Lisp in Small Pieces just use the triviality of parsing () languages, which I feel doesn't generalize well.
I emailed the author of PLAI (Shriram Krishnamurthi) about this. His response was effectively that modern books come off anti-parsing as a reaction to old books, which were parser heavy, and tools like YACC -- "Yet Another Compiler Constructor" -- even though it's just a parser generator, not a compiler constructor! He went further to say that, given parsing is roughly trivial in () languages, it sort of seems parsing is only incidentally a compiler/interpreter problem, and users of () languages view non-trivial parsing as signalling a design flaw. I found this to be an interesting take, but in my day job I generally don't have much say in the design of "languages" of semi-structured text that gets thrown my way.
Anyway, I know the Dragon Book covers parsing in some detail but for some reason it's been kind of impenetrable for me -- it feels a bit more abstract than I like. I can follow it, but while reading it I can't help but wonder -- "is this actually going to help me in practice?"
I recently have been reading Niklaus Wirth's stuff though, like the last chapter in his algorithms book and his Compiler Construction book, and those have been absolutely fantastic.
I also asked a question on SE about a particular parser I'm working on -- if anyone has some thoughts I'd love to hear them :)
https://codereview.stackexchange.com/questions/236222/recurs...