I enjoyed the article even though I'm in the opposite camp.
> Context-free grammars, and their associated parsing techniques, don't align well with real-world compilers, and thus we should deemphasise CFGs (Context-Free Grammars) and their associated parsing algorithms.
I agree with this. I think CFG are highly overrated. Top down recursive descent parsers are simple and allow you to craft more human languages. I think building top down parsers is something every dev should do. It's a simple technique with tremendous power.
I think the source code for Scroll (https://github.com/breck7/scroll/tree/main/grammar) demonstrates how liberating moving away from CFGs can be. Easy to extend, compose, build new backends, debug, et cetera. Parser, compiler, and interpreter for each node all in one place. Swap nodes around between languages. Great evolutionary characteristics.
I'll stop there (realizing I need to improve the docs and write a blog post).
> And no one will ever be able to implement a tool that works with the input language
But what do you get with such a tool? Syntax highlighting and cryptic error messages on the syntax only. And then you hit a wall and if you want to offer more to your users (refactoring, autocomplete, etc) you have to reimplement everything anyway).
> CFGs are equivalent to modularity in language design. A choice, clearly, but one with significant upsides.
My point above aside, you bring up a great point, and something I need to improve on a lot in Grammar (modularity so Tree Languages can be run on many host systems). Now my wheels are turning. Thanks!
> Context-free grammars, and their associated parsing techniques, don't align well with real-world compilers, and thus we should deemphasise CFGs (Context-Free Grammars) and their associated parsing algorithms.
I agree with this. I think CFG are highly overrated. Top down recursive descent parsers are simple and allow you to craft more human languages. I think building top down parsers is something every dev should do. It's a simple technique with tremendous power.
I think the source code for Scroll (https://github.com/breck7/scroll/tree/main/grammar) demonstrates how liberating moving away from CFGs can be. Easy to extend, compose, build new backends, debug, et cetera. Parser, compiler, and interpreter for each node all in one place. Swap nodes around between languages. Great evolutionary characteristics.
I'll stop there (realizing I need to improve the docs and write a blog post).