News for hackers. Stuff that matters.
Re:SQL is syntactic sugar for relational algebra by solumunus on Saturday March 23, 2024 @02:30AM (#39797903)
I agree that SQL syntax is terrible, but for some potentially masochistic reason I still like writing it. It could certainly be done better though and I don’t understand how there hasn’t been more innovation in this space.
Re:SQL is syntactic sugar for relational algebra by IshKebab on Saturday March 23, 2024 @04:01AM (#39798273)
There's PRQL which is really nice. But it has pretty big downsides: it only supports querying data, not modifying it; and since it's not database-specific it doesn't support all the features of whatever database you're using. E.g. it can't access complex data types like structs/arrays in DuckDB.
Re:SQL is syntactic sugar for relational algebra by refset on Saturday March 23, 2024 @05:37AM (#39798621)
> I don’t understand how there hasn’t been more innovation in this space

I think it's simply that most businesses and investors don't register SQL as having any real problems, and especially now with a resurgent interest in SQL the idea of attempting anything novel feels too risky.

Shameless plug of one recent attempt to offer something different: XTQL https://docs.xtdb.com/intro/what-is-xtql.html

Re:SQL is syntactic sugar for relational algebra by account-5 on Saturday March 23, 2024 @06:27AM (#39798819)
Having been forced to write queries as JSON in elastic I definitely prefer writing SQL. I would actively avoid utilizing any query language where I have to count brackets.
Re:SQL is syntactic sugar for relational algebra by refset on Saturday March 23, 2024 @06:50AM (#39798927)
Handcrafting JSON is undoubtedly always a pain, but the idea with XTQL is rather that it can be easily generated from any regular programming language.

> I would actively avoid utilizing any query language where I have to count brackets

That's really an editor/tooling problem, solvable in many ways, but I guess a Python-like/Parinfer approach would be your preference? (where whitespace/indentation is significant)

Re:SQL is syntactic sugar for relational algebra by account-5 on Saturday March 23, 2024 @09:19AM (#39799727)
True enough, tooling is key. I'm not a developer but I think SQL is a decent language that's easy to pick up. But I also like xpath, regex, and jq syntax too, so maybe I'm the weird one.
Re:SQL is syntactic sugar for relational algebra by bradleyjg on Saturday March 23, 2024 @07:50AM (#39799229)
PG’s blub essay isn’t especially charitable. There’s a good reason to want to stick with what you know and are comfortable with—-climbing endless learning curves means not getting things done and it isn’t simple to know ex ante what is worth the time
Re:SQL is syntactic sugar for relational algebra by refset on Saturday March 23, 2024 @08:27AM (#39799431)
Which is fine when everything is handcrafted and human-scale, but as soon as you start going down the path of machine generated SQL (both the generation and analysis thereof) the tax is non-trivial.
Re:SQL is syntactic sugar for relational algebra by masklinn on Saturday March 23, 2024 @01:33PM (#39801589)
It's not bad enough that it's worth actually trying to overturn, and the inertia from everything speaking SQL means there's a lot less pushback if you also do that.

SQL actually killed alternatives back in the 80s (and 90s, Postgres used to use a dialect of Ingres's QUEL, the "SQL" bit of PostgreSQL specifically denotes the switch over from QUEL to SQL).