-
To begin with, I am not at all qualified to understand the difference between Prolog/Datalog and miniKanren/microKanren. But, the way I see it, with a Datalog implementation like Mangle, data (within an RDBMS) would have to be exchanged with an external application. On the other hand, implementing a miniKanren/microKanren using a RDBMS's internal SQL PL would probably yield better performance by avoiding moving data out/in of the RDBMS. Again, I might be severely mistaken, and would appreciate anything you all could share to help me understand the value of Mangle to engage with a relational database like CockroachDB. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey there! Thanks for these questions. There are many approaches to logic programming. Your question mentions integration into RDBMS, so I assume you are asking about applied, practical questions.
(Datalog is particularly interesting, because recursion-free datalog corresponds exactly to relational algebra and can be rendered as a SQL query. In Mangle, this is not implemented, but it could be and it is already possible today to specify "modes" to indicate that a top-down mode of evaluating a query is preferred.)
In summary, there are many "small" problems can be solved elegantly with in-memory representations of data and logic programming (or constraint logic programming). When it comes to working with real data, it is not practical to export everything however it is often possible and practical to 1. first, query relevant data that fits in memory, 2. then, perform the in-memory evaluation. The easiest way to implement such a thing today would be to implement a FactStore which, whenever queried, actually translates the query to something a backend understands. This way, it is possible to query and combine any number of DBs, provided the queries send to those backends are specific enough that the resulting data fits into memory. More advanced approaches to processing such as stream processing are also possible in some scenarios, but would require a bespoke approach to evaluation. Hope this helps! Did I answer your question? |
Beta Was this translation helpful? Give feedback.
Hey there! Thanks for these questions. There are many approaches to logic programming. Your question mentions integration into RDBMS, so I assume you are asking about applied, practical questions.
(Datalog is particularly interesting, because recursion-free datalog corresponds exactly to relational algebra and can b…