By <@UHTPRR5SM> <https://twitter.com/vilterp/stat...
# thinking-together
c
o
This is so awesome!!!!!!
p
Thanks y’all! 🙏
❤️ 1
o
Also wonder about the potential for mining insights for yourself based on what your editor knowing about you and your habits.
g
@Chet Corcos in case you didn’t see this
c
Whoa. This is really cool! Thanks @Garth Goldwater!
I’ve been working in a project involving datalog as a durable database with p2p collaboration and sync.
i
I've read the article last night, awesome stuff there. It's been a while since I also started thinking that codebase should be treated as a portmanteau of code + database, so this article was right up my alley. However, it never occurred to me that Datalog could be used for the database, even though I played a bit with Eve. I always thought of using a graph database, such as Neo4j. @Pete Vilter did you follow any resource for your Datalog implementation? Do you know of any tutorial-like resource that shows how to do that? I'm pretty familiar with unification I'd say, since I wrote a few Hindley-Milner type inference implementations, but I haven't yet come across a good exposition of how to write a Datalog interpreter.
p
@Ionuț G. Stan the main guide I had is a simple interpreter that a friend wrote, which isn’t open source. So, really the best I can offer up is my own implementation (simpleEvaluate.ts in the repo; not guaranteed to be bug free 😛) or these miniKanren implementations (a minimal logic programming language): http://minikanren.org/
i
Thanks, @Pete Vilter. I did a bit of research last night and I found some other resources. Some people, though, make a pretty important distinction between Datalog and Prolog. I'm yet to understand the differences, but it will be fun.
👍 1
p
to be honest, I’m not completely clear on exactly what differentiates them — just that prolog is somehow more powerful / less decidable. there were some comments on my posts’s HN thread about this: https://news.ycombinator.com/item?id=23888656 (a bit over my head)
👀 1
i
Some good links and explanations in that HN thread, thanks.
c
I've found that the term "datalog" is often used to represent an idea more so than a concrete implementation detail whereas Prolog is an actual syntax+implementation. But in my experience, here are some differences: • Datalog tends to refer indexed 3-tuples, whereas prolog (and prepositional logic) deals with arbitrary N-tuples which tend to be prohibitively expensive to index. • Prolog allows for arbitrary recursion (I think) whereas Datalog tends to guarantee polynomial-time execution. <- this might be wrong • Datalog typically refers to a database where data is persisted whereas Prolog is programming language.
c
On the topic of Datalog implementations, I found the write-up by Frank McSherry really interesting. He describes the implementation of DataFrog (a bare-bones Rust embedded "datalog" impl) https://github.com/frankmcsherry/blog/blob/master/posts/2018-05-19.md It took me a couple sessions to encode the ideas, but it is still fascinating! We'll likely be using DataFrog as the basis of many parts of our type system, too!
👍 2