Re:Datomic 2013 Recap
by dustingetz on Wednesday January 08, 2014 @11:41PM
(#7028813)
You don't need it because since reads don't touch network you can run multiple queries with JVM code interspersed wth no network cost. So in your example you can query two sets seperately and do a set difference in your app process. Doing it in app process scales horizontally, doing the same thing in the database process (like SQL) scales vertically. So if they were to implement this in datalog, per my understanding they would probably be doing it in your process anyway.
Negation is a pretty common addition to datalog, along with group-by, max, min and other non-monotonic operators. It merely requires stratification.
This looks cool, I'll have to check this book out. For people who are interested, this is from Foundations of Databases (http://www.amazon.com/Foundations-Databases-The-Logical-Leve...) and is available for free at the root url from jamii's link.
edit: realized it's a referral link, it's not mine, it's because I got there through Rich Hickey's list of books that influenced clojure: http://www.amazon.com/Clojure-Bookshelf/lm/R3LG3ZBZS4GCTH
Re:Datomic 2013 Recap
by stuarthalloway on Thursday January 09, 2014 @08:07AM
(#7030201)
We (Cognitect) appreciate the power of negation, and it has always been part of the plan. From a priority perspective, negation doesn't open categoric new possibilities for our customers in the way that excision, or the log API, or a new storage option does. But we will get there.
One thing that fascinates me is that Datalog (the query language of Datomic and a precursor to SQL) doesn't have negation. (ie in an SQL query you can use the NOT operator in your WHERE clause - but you don't have the equivalent in Datomic datalog at present). It seems to be a low priority feature.
https://groups.google.com/forum/#!topic/datomic/UBWzp4nYOMk
They very gently touch on this in the rationale page: Datalog with negation is of equivalent power to relational algebra with recursion. Which seems to suggest you don't need it.
http://www.datomic.com/rationale.html