Get the latest tech news
Thoughts on DuckDB's Crazy Grammar Thing
It is the job of modern programming languages to be amenable to abstractions. It should be easy for users to take a little bundle of functionality and reuse...
If you accept that a grammar is something you are able to build up algebraically and dynamically, maybe there's another route you can go, which is to break up the language, somehow, by features which know both how they are to be described syntactically and how that syntax is to be interpreted semantically: Obviously this is not without its problems, there is some hairiness to be resolved here as the DuckDB paper calls out, and the SQL semantics are not really orthogonal enough to make this feasible for the common, baseline parts of the language. SQL itself has a lot of weird extensions even in the standard that have some level of utility but speaking from experience, you would not want clogging up your monolithic grammar file or AST definition.
Or read this on Hacker News