3 ms·
Nice! It's always good to see Datalog in action. In my experience, Datalog is often more convenient and more readable than SQL. As the post mentions, the curre
by triska 8y ago
Nice! It's always good to see Datalog in action. In my experience, Datalog is often more convenient and more readable than SQL.
As the post mentions, the current ergonomics ("a wall of definitions") are indeed the main shortcoming of the present approach, which is syntactically far removed from Datalog.
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.
- a-saleh 8y agoI think it will be better if we figure out how to do embedded catalog in other languages. I.e. I really liked The research here https://github.com/rntz/datafun https://github.com/rntz/datafun, where we start with "datalog=relational algebra+fixpoints" and then are trying to figure out how far can we take this in language where not everything is a table of facts :)
- convolvatron 8y agoschelog by Dorai Sitaram https://ds26gte.github.io/schelog/index.html https://ds26gte.github.io/schelog/index.html is a classic version of a funtional/declarative hybrid as a purely operational artifact. apparently its still being updated, but I remember it from many years ago (early 90s?). it uses the ability to return multiple times from a continuation to allow sets of results (streams or solution trees) to be expressed directly in scheme and intermixed freely with the functional subset. a 'nice' mixture of declarative and procedural would be really slick. i should go back and look at mozart/oz again. I'll definately see if my limited ability to deal with formalisms lets me understand the type system proposed in Datafun.
- a-saleh 8y ago"Streams of solution trees" kinda reminds me of mikro-kanren [1]. When I was using Clojure roughly 3 years ago, kanren was quite popular embedded logic. W.r.t. Datafun, i learned about it from a talk its creator gave on strangeloop last year [2], for me it seemed quite approachable :) [1] http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf [2] https://www.youtube.com/watch?v=gC295d3V9gE https://www.youtube.com/watch?v=gC295d3V9gE