
LogicBlox – Datalog REPL Tutorial - macmac
https://developer.logicblox.com/content/docs4/tutorial/repl/section/split.html
======
chubot
Funny to see this come up -- I just read this paper by a primary author of
LogicBlox:

 _Next-Paradigm Programming Languages: What Will They Look Like and What
Changes Will They Bring?_

[https://arxiv.org/abs/1905.00402](https://arxiv.org/abs/1905.00402)

(In addition to seeing it cited by the Souffle paper I mentioned in a sibling
comment.)

It was an interesting paper that gives a flavor for logic / declarative
programming, e.g. how to reason about performance, and the problem of tiny
changes causing asymptotic performance differences (a problem that SQL
shares).

But I think it is mistitled -- it really is about a particular problem domain
and is not about programming languages in general.

~~~
dustingetz
Thanks for that paper, he didn't use these words but I might summarize it as
predicting a merger/unification of programming language with database.
Expressing programs as declarative operations over data with an optimized
implementation injected by a compiler.

------
pgt
Great starting point for learning Datalog interactively:
[http://www.learndatalogtoday.org/](http://www.learndatalogtoday.org/)

------
YeGoblynQueenne
Uh-oh.

    
    
      Unable to connect, sorry! Internal error message: HTTP Error 502: '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <html><head>
      <title>502 Proxy Error</title>
      </head><body>
      <h1>Proxy Error</h1>
      <p>The proxy server received an invalid
      response from an upstream server.<br />
      The proxy server could not handle the request <em><a href="/connectblox">POST&nbsp;/connectblox</a></em>.<p>
      Reason: <strong>Error reading from remote server</strong></p></p>
      <p>Additionally, a 502 Bad Gateway
      error was encountered while trying to use an ErrorDocument to handle the request.</p>
      </body></html>
      '
    
      addblock 'cost[icecream] = c ->
         string(icecream), int(c).'
    
      No active workspace
    
    

Is that HN's hug of death now?

~~~
macmac
Not sure, I reported it to LogicBOx who's looking into it.

------
jules
What's the current state of the art in Datalog performance?

~~~
JimmyRuska
RDFox uses datalog to apply inference rules to graph data, it has some state
of the art algorithms for making datalog multi-core. It still uses SparQL,
which is really similar to datalog for querying. There's some recent work on
horizontally scaling datalog queries, but I hadn't seen anything in
production.

Probably the most popular implementation is datomic and its free variants.
Which has a lot of convenience to it as you can embed custom java functions.

It's not datalog but cypher has a lot of amazing ideas like easily combining
algorithms to potentially recursive relationship queries, eg, "Give me the all
shortest paths between these two peoples where there's at most 6 hops" ->
allShortestPaths((n1:Person)-[*..6]->(n2:Person)) .

~~~
refset
I work on Crux [0], which is also a Java-friendly Datalog database. It sits on
top of lazy EAV indexes in RocksDB/LMDB so it's pretty fast and scales well
(though technologies like Neo4j/GraphBLAS will be faster!).

We don't have online REPL just yet but Nextjournal is pretty great if you want
to play through the tutorials interactively [1]. The other unique angle is
that Crux gives you "bitemporal" Datalog queries. Oh and the MIT license :)

[0] [https://opencrux.com](https://opencrux.com)

[1] [https://nextjournal.com/crux-tutorial/](https://nextjournal.com/crux-
tutorial/)

