What can Datomic Rules do that a Peer query cannot?


The best example of rules I know of is mbrainz graph traversals: https://github.com/Datomic/mbrainz-sample/blob/master/src/clj/datomic/samples/mbrainz/rules.clj

I think graph traversals are much clearer with peer functions, like this: http://www.hyperfiddle.net/:cookbook!datomic-query-loom/

I think I understand that rules let you “macroexpand” datoms into new datoms (that don’t actually exist), but peer functions can do the same thing, right?

So what is it that rules do better?


Here is another example of rules: user/group/permissions with rules


I am wrong, rules do not expand into datoms, they expand into clauses