3 ms·
A good way to try Datalog is to use a state-of-the-art Prolog system that supports SLG resolution (tabling). SLG resolution is an evaluation strategy of Prolog
by triska 7y ago
A good way to try Datalog is to use a state-of-the-art Prolog system that supports SLG resolution (tabling).
SLG resolution is an evaluation strategy of Prolog programs that provides favourable termination properties compared to SLDNF resolution which is Prolog's default execution strategy.
A great example for this is XSB Prolog, since it has pioneered and refined many of these techniques and serves as an example and benchmark for many other Prolog systems in this area:
https://xsb.com/xsb-prolog https://xsb.com/xsb-prolog
The nice thing is that this approach allows you to use Datalog, and at the same time gives you a Turing-complete programming language that is comparatively easy to grasp once you understand Datalog, while sharing many of the same advantages and being syntactically only a slight extension of it.
- mycall 7y agoA turning complete query language sounds like a recipe for DoS attacks.
- maweki 7y agoIt is only Turing complete if you allow new rules. Usually a client would only be allowed to formulate query goals. In that sense, GraphQL is Turing complete as well, as the underlying implementation could just simulate a Turing machine.
- onion2k 7y agoWhat I read from your post here is that GraphQL is safe by default and would require effort to make it dangerous while Datalog is dangerous by default and would require configuration to make it safe. I know which one I'd rather put on a server.
- maweki 7y agoYou have read that incorrectly. A Datalog/Prolog query does not define new rules. That's like calling arbitrary code on remote machines. You would never allow that. But IF you were allowed to define new rules, THEN you could simulate a turing machine or create infinite reductions.
- deleted 7y ago[deleted]
- tastroder 7y ago> A great example for this is XSB Prolog, I'm really sorry but it honestly cannot be. I was curious because Datalog/Prolog based technologies are intriguing so I clicked on that link. https://xsb.com/xsb-prolog https://xsb.com/xsb-prolog seems to have no download but links to http://xsb.sourceforge.net/ http://xsb.sourceforge.net/ which claims version 3.8 (October 2017) is current and links to http://xsb.sourceforge.net/downloads/downloads.html http://xsb.sourceforge.net/downloads/downloads.html which does not specify a version but offers a tar.gz that contains version 3.7 from July 2016. Going back to sourceforge and heading to the SVN https://sourceforge.net/p/xsb/src/HEAD/tree/trunk/XSB/ https://sourceforge.net/p/xsb/src/HEAD/tree/trunk/XSB/ states version 3.9, November 2019 and looks pretty active commit-wise. Okay, let's do that. Checking out trunk, I see perl and C scrolling by. While I have no problem with Perl, I know quite a few developers - especially in the web context - that find it rather off-putting. I get a README that tells me to read the manual in order to install. Fair enough. Opening that ( http://xsb.sourceforge.net/manual1/manual1.pdf http://xsb.sourceforge.net/manual1/manual1.pdf ) gives me a 622 page PDF from October 2017. Chapter 2: "Make sure that after you have obtained XSB, you have uncompressed it by following the instructions found in the file README." There were no such instructions. But well, configure and make are in build, that's fine and the rest of the instructions are clear. I was confused why configure looked for mysql and make did something with Java but whatever, both worked great out of the box. Let me check the binary. I get a REPL, claiming to be version 3.8 from October 2017 and despite having 7 lines of output I have no idea how to quit out of that process, so I turn to Google which gives me http://xsb.sourceforge.net/shadow_site/manual1/node14.html http://xsb.sourceforge.net/shadow_site/manual1/node14.html Neither ctrl^c, nor ctrl^d work, and halt + return is ignored. I go ahead, kill the process and delete the directory. Alternatives to the above? That original site tells me to contact some organisation, "xsb prolog" on Google turns up ancient results. Now compare that with https://graphql.org/graphql-js/ https://graphql.org/graphql-js/ Just like many of these rather research centric languages, it does not matter how cool their tech is if that's the first experience people get. In my view experiences like the above are why they fail to gain adoption in today's world, not some technical aspect or technique. At least unlike much of the linked data and SPARQL world this thing compiled out of the box and I would have been up and running in about 10 minutes if I had any intention to continue.
- 7y ago