News for hackers. Stuff that matters.
Re:Prolog Coding Horror by christophilus on Sunday May 17, 2026 @06:30PM (#48173756)
Dunno about Prolog, but Datomic uses datalog for its query language, and it’s excellent. Datalog is a subset of Prolog.
Re:Prolog Coding Horror by ted_dunning on Sunday May 17, 2026 @07:12PM (#48173976)
Datalog may appear to be a subset, but it is quite distinct semantically.
Re:Prolog Coding Horror by raffael_de on Sunday May 17, 2026 @07:13PM (#48173978)
What is Datalog used for nowadays?
Re:Prolog Coding Horror by AlotOfReading on Sunday May 17, 2026 @07:42PM (#48174150)
Other than databases, program analysis. The polonius borrow checker in rustc uses datalog internally.

But you can use it for lots of things. Whenever I'm frustrated with graph based tools being slow (like build systems), I run the graph through a datalog engine for comparison. It's usually much, much faster.

Re:Prolog Coding Horror by gobdovan on Sunday May 17, 2026 @09:30PM (#48174750)
General programming [0], static analysis [1], RDF triple stores [2], authorization systems [3], incremental computation [4] [5], graph DBs [6]. But it is kind of hard to define Datalog exactly, since it is an entire family of technologies based on logic, each extending a clean mathematical model differently.

[0] https://github.com/flix/flix

[1] https://github.com/rust-lang/polonius

[2] RDFox

[3] https://github.com/eclipse-biscuit/biscuit

[4] https://github.com/vmware-archive/differential-datalog [5] https://github.com/brurucy/pydbsp

[6] https://github.com/cozodb/cozo

Re:Prolog Coding Horror by raffael_de on Monday May 18, 2026 @01:29PM (#48182629)
thanks for your list. appreciated. my question should have been more precise. last time I checked all the Datalog projects I found where either old, unmaintained or have only a single contributor. and that is also true for your examples. I really like Prolog and would love to use Datalog for (RDF) knowledge graph inference.
Re:Prolog Coding Horror by harperlee on Monday May 18, 2026 @01:43PM (#48182836)
Then use them! Then those projects will cease having a single contributor or being unmaintained. This doesn't need to be a binary decision (either there is no risk or I won't use it), just choose the project / scope with knowledge that there is some risk in a small community; so internal use rather than client facing, specialized uses, etc.
Re:Prolog Coding Horror by raffael_de on Monday May 18, 2026 @01:55PM (#48183017)
not sure how using a project adds a contributor. but for the latter - I'm not sufficiently competent at Prolog and friends to meaningfully contribute. I do donate money, though, to projects I regularly use - like for example FreeTube or Linux Mint.
Re:Prolog Coding Horror by gobdovan on Sunday May 17, 2026 @09:17PM (#48174678)
Datalog is not a subset of Prolog. It looks that way because both are based on Horn clause logic, while Prolog is more expressive.

This loops Prolog, but terminates in Datalog:

p :- p.

p.

?- p.

This is because the underlying mechanism is completely different. Datalog is like SQL with recursion, you start with known facts and repeatedly applies rules to derive all consequences until nothing new appears. In Prolog, you start from the query and works backward through rules until it either finds a proof or fails.

So, Datalog treats Horn clauses as database constraints/inference rules while Prolog treats Horn clauses as a search program. They use the same mathematical substrate, but completely different computational models.

Re:Prolog Coding Horror by ux266478 on Monday May 18, 2026 @10:00AM (#48180035)
The full story the other comments don't cover:

- Datalog is a syntactic subset of Prolog

- Real Prolog implementations generally have the ability to configure their runtimes such that it becomes a proper superset of Datalog