logoalt Hacker News

vlovich123last Wednesday at 4:10 PM3 repliesview on HN

I believe Rust uses datafrog, Datalog as a library to implement some of its next gen solvers for traits and lifetimes. Not a lisp and maybe this still isn’t as elegant as you had in mind? Curious how this library compares for you.

https://github.com/rust-lang/datafrog


Replies

brabellast Wednesday at 6:29 PM

If you want to see what it looks like when you actually embed Datalog in your language, have a look at Flix: https://flix.dev/

(Select the "Usinag Datalog..." example in the code sample dropdown)

The Rust code looks completely "procedural"... it's like building a DOM document using `node.addElement(...)` instead of, say, writing HTML. People universally prefer the declarative alternative given the choice.

erulast Wednesday at 4:31 PM

Haskell can do the same, and does with a lot of little embedded DSLs.

show 1 reply
debugniklast Thursday at 10:27 AM

The experimental "Polonius" borrow checker was first implemented with datafrog, but I believe it's been abandoned in favour of a revised (also "Polonius") datalog-less algorithm.