For those who may have missed it, Mozilla is working on Datalog knowledge store backed by SQLite called Project Mentat [1] (also written in Rust).
Announcement and rationale written by one of its devs can be found here [2].
Also previous HN discussion is located here [3].<p>[1] <a href="https://github.com/mozilla/mentat" rel="nofollow">https://github.com/mozilla/mentat</a><p>[2] <a href="https://medium.com/project-tofino/introducing-datomish-a-flexible-embedded-knowledge-store-1d7976bff344" rel="nofollow">https://medium.com/project-tofino/introducing-datomish-a-fle...</a><p>[3] <a href="https://news.ycombinator.com/item?id=13568559" rel="nofollow">https://news.ycombinator.com/item?id=13568559</a>
For some interesting backlog here: As Rust moves from lexical to non-lexical lifetimes, there's been a few different ways of actually implementing it. The initial implementation had some bugs and was fairly slow; but Niko had some other ideas: <a href="http://smallcultfollowing.com/babysteps/blog/2018/04/27/an-alias-based-formulation-of-the-borrow-checker/" rel="nofollow">http://smallcultfollowing.com/babysteps/blog/2018/04/27/an-a...</a><p>The initial implementation used differential dataflow, but this was just merged in: <a href="https://github.com/rust-lang-nursery/polonius/pull/36#issuecomment-390393717" rel="nofollow">https://github.com/rust-lang-nursery/polonius/pull/36#issuec...</a><p>Very cool stuff!
Nice! It's always good to see Datalog in action. In my experience, Datalog is often more convenient and more readable than SQL.<p>As the post mentions, the current ergonomics ("<i>a wall of definitions</i>") are indeed the main shortcoming of the present approach, which is syntactically far removed from Datalog.<p>My suggestion towards an automated conversion is to consider Prolog: Syntactically, a Datalog clause is a valid Prolog term. In fact, Datalog is a syntactic subset of Prolog. Therefore, it can be easily parsed with Prolog (using the predicate read/1), and then inspected via built-in mechanisms. You may be able to write a Prolog program that converts proper Datalog definitions to such Rust snippets.
Since DataLog is just a subset of Prolog I want to link a very good book about modern Prolog and its applications [1].<p>[1]. <a href="https://www.metalevel.at/prolog" rel="nofollow">https://www.metalevel.at/prolog</a>
Awesome. I look forward to browsing its code.<p>I implemented a Datalog engine in Java a while back. Looking back on it now there are a bunch of things I might have done differently, but I've never tried to implement anything like it before.<p>I remember that doing the stratified negation was quite complex and I won't be able to explain it of the top of my head anymore.<p>Anyway, here's my version: <a href="https://github.com/wernsey/Jatalog" rel="nofollow">https://github.com/wernsey/Jatalog</a>
If you want a Go implementation, look at OPA <a href="https://github.com/open-policy-agent/opa" rel="nofollow">https://github.com/open-policy-agent/opa</a> - designed for authorization but quite general.
What would be some advantages of this design over the µKanren design [0] which uses a search monad [1] and expresses unification and relations directly as plain values and functions?<p>[0] <a href="http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf" rel="nofollow">http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf</a><p>[1] <a href="http://homes.soic.indiana.edu/ccshan/logicprog/LogicT-icfp2005.pdf" rel="nofollow">http://homes.soic.indiana.edu/ccshan/logicprog/LogicT-icfp20...</a>