For an alternative take on a related topic, this is really a fantastically well-written and practical (free) book: http://craftinginterpreters.com
Parsing Algorithms
21–30 of 87 posts
Re: Parsing Algorithms
#22For an alternative take on a related topic, this is really a fantastically well-written and practical (free) book: http://craftinginterpreters.com
Not free but also very good is https://interpreterbook.com/
Re: Parsing Algorithms
#23I'd like to see something like this for practitioners. I kind of have a feel for what's out there, but I don't know of anything that is: 1. pleasant to use 2. simple 3. scannerless 4. supports left recursion that produces a left-associative parse
1. is subjective.
Re: Parsing Algorithms
#24Earlier quoted context omitted.
I found the code for Instaparse (relatively) easy to follow. I had considered leaving a comment here like "hey could you cover combinators and PEGs?", but after thinking it over, it's important to limit the scope for a class like this. It would be pretty great to offer a "201" edition, covering ALL*, GLR, GLL, combinators/PEGs, Earley, parsing-with-derivatives, Marpa, and anything else I might have forgotten: basical…
What is GRR? Did you mean GLR?
Re: Parsing Algorithms
#25Earlier quoted context omitted.
Great point on combinators, PEG, and GLL -- this potentially would be covered in 201 as suggested, since it's good having a foundation of the LL/LR, and then gradually moving to combinators if needed. LALR(1) covers a pretty wide range of the most practical languages.
To a significant degree, the arrow of causality runs LALR(1) -> practical languages, not the other direction! The languages and formats we use have been heavily shaped by the practical parsing algorithms of the 20th century. An example: you can't have a struct field called "while" in C, because once the lexer declares a token to be a keyword, that's that.
Re: Parsing Algorithms
#26That said, I really recommend the crafting interpreters work. It covers all the bases pretty solidly. If you want more depth and theory then get the dragon book (Ullman on compiler design) and read it afterwards :-)
Re: Parsing Algorithms
#27Earlier quoted context omitted.
Just generalized parsing algorithms in general would be good to include, I think. It looks like the course only plans to cover basic LL/LR, which are admittedly the most commonly used parsers but more would be interesting. A fun one to include might be Might's "Parsing with Derivatives", which is algorithmically novel (though not very performant). I think there was a recent innovation on this: "Parsing with Zippers"…
Thanks for mentioning "Parsing with Zippers"! I read "Parsing with Derivatives" last week and wondered if that could be taken further. The paper can be found here: https://dl.acm.org/doi/10.1145/3408990
As for PwZ, I know one of the authors so maybe I'm a little biased, but I also thought his ICFP talk was quite good. It's here: https://youtu.be/fakSKvP9yaM?t=6180
Re: Parsing Algorithms
#28Earlier quoted context omitted.
What is GRR? Did you mean GLR?
Yep, that was a typo, fixed it
Re: Parsing Algorithms
#29Re: Parsing Algorithms
#30For an alternative take on a related topic, this is really a fantastically well-written and practical (free) book: http://craftinginterpreters.com
For runtime semantics (Interpreters and Virtual Machines) you can address "Essentials of Interpretation" aka "Building an Interpreter from scratch".