4 ms·
Datalog is a subset of prolog, which is not Turing complete. But, by giving up the ability to compute anything, you get a fully declarative language (the order
by richard_todd 11y ago
Datalog is a subset of prolog, which is not Turing complete. But, by giving up the ability to compute anything, you get a fully declarative language (the order of clauses doesn't matter) whose computations always terminate. In contrast, when programming in prolog you are often thinking about the operational aspects of the underlying engine in order to get more efficiency. You try to order clauses advantageously and introduce extra-logical commands like "cuts" to guide the engine, so prolog code often looks more declarative on the surface than it is in reality. As a result, I've heard Datalog referred to as "the good parts of Prolog," and I suppose that for problems it can handle I do like that Datalog has fewer pragmatic compromises to its purity.
- ScottBurson 11y ago> Datalog is a subset of prolog, which is not Turing-complete. I wouldn't normally object to a misplaced comma on HN, but in this case it is potentially very confusing. This sentence as written says that Prolog is not Turing complete, but actually it is; it's Datalog that is not Turing-complete. (I'm sure that was the intent.)
- richard_todd 11y agoAbsolutely: Datalog is the one that is not Turing-complete. Thanks for pointing this out. I typed it on my phone and should have proofread it better. I'd remove the comma, but I think HN doesn't let me edit a post after a timeout.