3 ms·
I don't really have time to watch a video at the moment, but I'm not really sure what the significance is. If you allow look-ahead, I would think that most pop
by mikekchar 10y ago
I don't really have time to watch a video at the moment, but I'm not really sure what the significance is. If you allow look-ahead, I would think that most popular languages can be parsed with an LALR(2) parser (e.g. yacc/bison). I've even implemented the SIP protocol with an LALR(K) (antlr) parser and SIP is insane :-). I often wonder about Ruby, especially with the leading period that's allowed. But there are a lot languages with really simple grammars out there. I can't imagine that python is anywhere near the top of the list. In practical terms, simple grammars make it easy to write tools. I suppose you can also save stack space if you have simple grammars, which may be significant in some situations. Other than that, I'm not sure why it matters. Can you elaborate a bit more?
- scribu 10y agoI don't think there's any great significance behind it. I guess I jumped at the idea because it seemed to provide a simple theoretical explanation as to why Python is easier to grok than other languages which don't have context-free grammars.
- gary_bernhardt 10y agoYep, that was my motivation: to hint at deeper connections to programming at large, rather than focusing on technical concerns that are confined to parser implementation and therefore esoteric to an outsider.