[HN Gopher] Learn Datalog Today
___________________________________________________________________
Learn Datalog Today
Author : cube2222
Score : 54 points
Date : 2021-05-16 14:21 UTC (8 hours ago)
(HTM) web link (www.learndatalogtoday.org)
(TXT) w3m dump (www.learndatalogtoday.org)
| tannhaeuser wrote:
| Unfortunately, the term "Datalog" has been used inflationary to
| mean anything to anyone as an attempt to market proprietary DBs
| at this point.
|
| See [1] in case you're wondering what Datalog actually is.
|
| [1]: https://en.m.wikipedia.org/wiki/Datalog
| iimblack wrote:
| This is one of those things that has always sounded really
| interesting but I haven't had the opportunity to use. Does
| anybody have experience with it? I'm also trying to find some
| benchmarks but don't see much.
| maweki wrote:
| As a real database language with ad-hoc-queries you're fine
| with SQL. Data-intensive graph analysis (the reason souffle,
| souffle-lang.org, was developed) where you have a fixed set of
| deduction rules and change the database instance is an ideal
| playground for Datalog.
|
| And souffle is incredibly fast and for the usual benchmarks,
| like the transitive closure in comparison to recursive CTEs in
| SQL, blows everything out of the water. (my paper on that
| http://ceur-ws.org/Vol-2368/paper3.pdf, Figure 3)
|
| I'm researching using Datalog as a general purpose programming
| language (specifically for use in microcontrollers, like
| Arduino) for my PhD and it can be very expressive.
| discreteevent wrote:
| Have you come across Eve? It was a general purpose language
| described as a variant of datalog. They ran out of money in
| 2018. Everything was a record, even the browser Dom. It's a
| shame we can't work in a world as consistent and simple as
| they tried to make it. http://witheve.com/
| maweki wrote:
| > Have you come across Eve?
|
| Apparently that link was already marked as "visited" in my
| browser history and it seems familiar.
|
| There seems to be a strong connection between reactive
| programming (especially the functional-reactive style) and
| Datalog. I believe that is the case because Datalog
| (simplification incoming) is a logic programming language
| that, contrary to ASP, for example, always returns a single
| model and can therefore always be seen as a function from
| input-relations (FRP cells) to output-relations where the
| deductive steps and intensional predicates are the streams.
|
| The issue is - and that's not really surprising - that
| implementing useful call-conventions for your application
| on top of a datalog-engine is not easier than using a fixed
| call-convention (like a (f)RP-framework) and implementing
| your deduction with simpler semantics.
|
| In the end, you have to bind your input and output-
| relations to your view and write down the rules and they
| are somewhat simple. With reactive programming you have a
| somewhat easier time binding your data to the views and the
| rules (functional mappings) are somewhat more difficult.
|
| That is why I abandoned the reactive style of using Datalog
| as a general purpose programming language early on. If you
| really want to do this, you can already use differential
| dataflow and some plumbing code and you would not have lost
| a thing.
|
| My approach is closer to Logic Production Systems.
| YeGoblynQueenne wrote:
| Is that an embedded Datalog then, that runs on
| microcontrollers?
|
| I'm researching approaches that learn Datalog programs from
| examples for my PhD. In practice, the algorithms I study can
| learn Prolog programs but Datalog is a nice, decidable subset
| of Prolog that also has the advantage that clause ordering
| doesn't matter so a learner only needs to learn the clauses
| in a program, without also learning to order them.
|
| There's a bunch of work from the program synthesis community
| on learning Datalog programs from examples. Here's a recent-
| ish paper I found interesting (and whose authors I'm not
| affiliated with):
|
| https://www.semanticscholar.org/paper/Syntax-guided-
| synthesi...
| maweki wrote:
| The approach is an iterative deduction with strict call-
| conventions. In some cases I compile the rules as-is into a
| C-Program, but if the used memory is provably bounded, I
| compile to a finite state machine + some registers. Had to
| ditch the extensional database for that. Not strictly
| necessary, as it turns out.
|
| You can read it here
| (https://doi.org/10.1007/978-3-030-68446-4_11, behind
| paywall) or hit me up on researchgate for that paper. Or as
| a short overview: https://dbs.informatik.uni-
| halle.de/microlog/
|
| The main problem, which I claim to solve, is the handling
| of side-effects. For the microcontroller (or a robot) it is
| vitally important to not have side-effects or at least have
| them explicit for the developer and the language semantics.
| I believe this is where most approaches fail, that they
| model effectful input-gathering just as input-relations,
| but you need to control your input as well as your output
| in an interactive application.
| refset wrote:
| Disclosing benchmark results is forbidden by the licensing,
| which isn't uncommon for proprietary DBs, e.g.
| https://stackoverflow.com/questions/12115397/is-it-against-l...
|
| Incidentally, I was writing up some notes earlier today about
| the nightly benchmarks we run for Crux (another Clojure-
| flavoured Datalog DB), which may be of interest:
| https://opencrux.com/articles/benchmarks.html
| yawgmoth wrote:
| I learned LogiQL [1] in 2012, which is a Datalog-inspired
| language. We were writing an OLAP system and wrote some pieces by
| hand but a large chunk of our star schema was generated via
| Python + templates.
|
| [1] https://www.routledge.com/LogiQL-A-Query-Language-for-
| Smart-...
| pm90 wrote:
| Heh, I read it as "learn datadog today". Which would also be an
| interesting article, as it took me quite a while to understand
| how its supposed to work.
| Vaslo wrote:
| I used it in a Data Curation course. Extremely difficult to learn
| and found it pretty useless. Entire class struggled with it. You
| can often use recursive SQL to some of what it does.
|
| Sorry to insult anyone or the creator but just being honest.
| Fellshard wrote:
| Did the class learn SQL before they learned Datalog? Did they
| know SQL before entering the class? Did they learn the
| principles behind SQL, or just understand how to use the
| language to get things done?
|
| Finding Datalog useless and frustrating comes from those who
| have never expanded the depth of their knowledge beyond the
| basic popular languages and tools of the day. Slight exposure
| to logic programming and base-level relational model theory
| makes this tractable.
| chmod600 wrote:
| "Finding Datalog useless and frustrating comes from those"
|
| There are many reasons that people might get frustrated. If
| you assume without further evidence that it's purely due to
| user ignorance then you aren't likely to learn about any real
| shortcomings.
___________________________________________________________________
(page generated 2021-05-16 23:01 UTC)