Hacker News new | past | comments | ask | show | jobs | submit login

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).




It's not a "javascript inspired language". It's the language you're using. If you're using Rethink from Python, you write your queries in Python, etc.

See, for instance, http://rethinkdb.com/api/python/

(You can easily translate most doc pages to the language of your choice using the links at the top of each page.


So, they're just shipping supported ORMs in multiple languages.


Its not an "ORM" though and ReQL _is the language_.


How can you say it's "the language" if it's different from one language to another?


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.

Could be a fun programming game.


All of the ReQL examples are completely unreadable relative to SQL.

Because SQL is very familiar and ReQL is not.


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:

  r.table('users').filter(r.row('age').gt(30))


> 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:

  r.table('users').filter{|row| row['age'] > 30}


With ES6:

  r.table('users').filter(row => row('age').gt(30))


You only write javascript if you're using javascript ;)

If you python you use python's native constucts, which if you use python you're naturally familiar with.

    r.table('users').filter(r.row['age'] > 30)


> 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.

My be an interesting third-party add-on, though.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: