6 ms·
Datalog is basically more of a paradigm than a single language: the "core" is just that you have Horn clauses and facts, and synthesize more facts (usually to f
by chc4 3y ago
Datalog is basically more of a paradigm than a single language: the "core" is just that you have Horn clauses and facts, and synthesize more facts (usually to fixedpoint) using those clauses. Everything on top is basically up to the implementation: a lot of modern Datalog implementations have lattice types, for example, so that introducing a new fact for the same subject "updates" the previous fact instead of duplicating. Or they might allow for negative clauses instead of only positive clauses, or implement the synthesizing in a way that is more efficient. But it's really up to the implementation what set of features they implement, and what syntax to use for it, since there isn't a specification or agreed upon set of features for what "Datalog" is if you say you use it.
- refset 3y agoTo add to this description, the Prolog-derived syntactic core of Datalog (the Horn clauses and facts) can be viewed as a combination of "unification" and mutually recursive rules to find a fixpoint over your data+query. It's essentially like solving simultaneous equations. The Prolog-derived syntax is routinely extended because the core is typically too simplistic/inexpressive to be directly useful, e.g. see https://www.fdi.ucm.es/profesor/fernan/des/html/manual/manualDES.html#_Toc81673921 https://www.fdi.ucm.es/profesor/fernan/des/html/manual/manua...
- convolvatron 3y agothe 'verse' language by SPJ and co explores the notion that datalog semantics can be expressed using 'normal' programs in SSA form. As long as you use pure values this works out quite well. there are some convenient normal datalog abstractions like implicit union of clauses with the same name that don't map so well. I expect this is going to show up as a really popular model at some point - don't have to have two separate worlds for queries and other logic.
- refset 3y ago> don't have to have two separate worlds for queries and other logic That's definitely the dream. Another point along that spectrum (from the author of Apache Calcite): https://github.com/hydromatic/morel https://github.com/hydromatic/morel