Hacker News new | ask | show | jobs
by tuke 1326 days ago
Nice. The embedded querying is neat.

I see the query language goes: `select ... from`

One thing I like about query languages that start with the "from" class is that then it's easier in REPLs to provide suggestions for what can be selected.

You type, say, `from people` and you can get a suggestion for `name`.

1 comments

Having written an sql parser, I very very strongly agree.
I'm curious to know which part of the parsing becomes easier with Select moved later in the statements?

Typical argument for the "From table select column" are due to better matching evaluation logic and improving type-ahead suggestions in IDE's, but I haven't yet heard the argument that it also makes parsing simpler.

Good question, my answer was misleading. It changes virtually nothing in the parse or in the resulting AST.

Writing the parser as a process has made me (even) more familiar with SQL syntax and semantics and understand it better, which has only increased my disgust[1] of the whole matted thorny snarl that it is. I was asking for a dose of rationality for Lil, not a syntactic infection inherited from a misdesigned language. HTH.

(BTW the designers of SQL knew well that it had other problems and admitted them, eg. search for "A Critique of ANSI SQL Isolation Levels").

[1] yeah, that's the right word.