All of the ReQL examples are completely unreadable relative to SQL.
Call it declarative, format it however you want - a purpose-built DSL like SQL is always going to be easier to grok than a Javascript-inspired functional language (for me at least).
Depends on your perspective I guess. Having struggled with building easily composable SQL queries for almost 20 years now, I'll take the functional language approach thank you very much.
Thank you, I updated my statement to reflect that.
However, I am imagining a contest where SQL people write SQL and functional people write functional queries... I would bet money that SQL people could identify basic facts about SQL queries faster than functional people could identify the same facts about functional queries.
I think it's more because the javascript-with-callbacks is chatty and ugly. But you can also write it in a more stream-like style. I have no idea why so many examples out there use the nastier style. An example stolen from another commenter:
> I think it's more because the javascript-with-callbacks is chatty and ugly.
We did the best we could with JavaScript. IMO the Ruby implementation of ReQL is dramatically more beautiful. Ruby's blocks fit so well that we don't even provide the `r.row` shortcut in ruby:
> All of the ReQL examples are completely unreadable relative to SQL.
I don't actually agree with this, but one solution to this would be -- as Google has done with several of its not-traditional-db storage products -- to build a library that takes strings in an SQL-like language (SQL with additions/deletions to align with RethinkDB's features and capabilities) and builds ReQL objects from them. But, while it might have utility, its probably not as high a priority for the RethinkDB team as getting the core features right.
I seem to recall them saying a few years ago that they were not going that way for a reason. That they are opting for an intelligent protocol/driver approach instead so that there is more control over how data is passed and error handling is done... but I don't remember the details
Call it declarative, format it however you want - a purpose-built DSL like SQL is always going to be easier to grok than a Javascript-inspired functional language (for me at least).