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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of thoughts

thoughts

Photo of DuckDB

DuckDB

Photo of crazy grammar thing

crazy grammar thing

Related news:

News photo

Thoughts on the software industry (2022)

News photo

Thoughts on Bluesky

News photo

Thoughts on this? "ChatGPT ‘drinks’ a bottle of fresh water for every 20 to 50 questions we ask, study warns"