Differential Datalog: a programming language for incremental computation
github.com
github.com
"Incremental" is actually a special case of dynamic, where all updates are restricted to 'adding' input data only. (Thus "incremental" algorithms, properly understood, are closely related to "online" algorithms, e.g. those which process input data in a streaming fashion as opposed to assuming a "complete" input to begin with.)
But I love these. From Functional Reactive Programming through propagator networks and embedding functional languages in datalog datafun-style, there seems to be this new-ish approach to computation that maybe somebody finally cleaves out of academia! The eve-lang guys were close but too ambitious. Maybe VMWare has less ambitious, more focused tool in mind.
Because datalogs are so cool! But only time I see them in practice are bespoke implementations for like ... compiler optimization tuning?
> This project got put together rather suddenly, in response to some work the Rust folks are doing[1] on their new and improved borrow checker.
I don't think I could tell you more than "Frank wrote it to help rust folks who were previously doing work with differential-dataflow directly."
1. https://github.com/rust-lang/polonius/pull/36#issuecomment-3...
https://news.ycombinator.com/item?id=26514456 - March 20, 2021 (62 comments)
A few other submissions, but all with 0 comments.
There's a tool in Rust called Salsa that's tailored for this, but it's galaxy-brained (I watched an hourlong introduction video and could still barely grasp it).
I'm not sure what the delta between Salsa and differential-dataflow is. My experience with differential-dataflow is that it's also galaxy brain.
[blog]: https://github.com/frankmcsherry/blog/blob/master/posts/2018...
[datafrog]: https://github.com/rust-lang/datafrog
I can relate to that. What helped me to understand it though is looking through some projects using Salsa [1] and reading the document about how the Rust compiler uses queries [2]. You might also want to watch the discussion video with Anders Hejlsberg [3] that gives an overview of the problems that Adapton/Salsa try to solve.
[1] https://crates.io/crates/salsa/reverse_dependencies
[2] https://rustc-dev-guide.rust-lang.org/query.html
[3] https://learn.microsoft.com/en-gb/shows/seth-juarez/anders-h...
One advantage of self-adjusting computation vs. the differential dataflow approach is you can convert existing imperative code to it very easily. For example, a ray tracer with self-adjusting computation is written very similarly to a ray tracer without it.
There's a C++ library that implements parallel-friendly self-adjusting computation here: https://github.com/cmuparlay/psac
I see no reason why a Rust version couldn't be implemented.
Is it the same idea as presented here? https://github-com.translate.goog/nin-jin/slides/blob/master...
I think differential dataflow is very interesting and could be very useful at scale for certain businesses but I just don't get the need for the lang.
And I'll plug for https://bytewax.io/ which is one company I know doing interesting things within the niche!
(I have no association to it besides having talked with the founder once upon a time.)
SQL interface on Differential/Timely Dataflow = https://materialize.com/
Python interface on Differential/Timely Dataflow = https://bytewax.io/
Grossly oversimplified, but directionally correct.
http://www.learndatalogtoday.org/
Maybe some useful scientific applications I am not aware of?
I think Datalog got some attention in the 1980s as a logically pure dialect of Prolog, then it practically disappeared from the literature for a while. I remember it being really hard to find anything about it around 2008, then when people got really tired of OWL and other semantic web tools Datalog came roaring back in the 2010s.
Like the semantic web tools people have a hard time recognizing bog-standard database technology when they have been slightly reskinned and Datalog has long had that problem. One issue is that SQL has this crazy idiosyncratic syntax that hides the fact that it has a simple set of operators behind it, in the case of Datalog the operators are quite directly exposed which people seem to find too simple to understand.
https://news.ycombinator.com/item?id=33518320
(On cozo, a new embedded SQLite like database with datalog as a language, written in Rust).
In databases views are really powerful how we can build virtual tables that are based on joins and other data.
The value comes when we can update the underlying data from the view. This is what I want for computation. I'm not sure if differential dataflow can provide this.
Yes, it can, but you will have to write the views yourself, in Rust.
Materialize (https://materialize.com) exists, though, and compiles SQL to differential-dataflow programs, in order to provide exactly what you're asking for.
(I work for Materialize)
We didnt get whole fields of mathematics until a clear syntax was developed; and likewise, what patterns of thinking a syntax affords makes a big difference to the designs one chooses.
The effect is bigger when writing not writing "glue code". The goal of threading data through libraries and applying simple business rules to it is a kind of problem best solved by existing mainstream syntaxes.
That doesn't mean, as is often implicitly assumed, that therefore all syntax is basically equivalent.
It has been a while since a new version has been released. Has anything been published regarding future plans? Or is the current version "feature complete" for the foreseeable future?
> DDlog is now in maintenance mode, because we're working on a new streaming and [incremental computation framework][1] that will be more powerful in multiple ways. We still have customers using DDlog, so we fix issues as they come up, but not working on any new features.
^1: I'm not an expert on Differential Dataflow, so I don't know what "efficiently" means in this context, other than "should be faster than running the query from scratch."