Skip to main content

Language

FlowLog is a Datalog-based language that compiles to efficient Differential Dataflow executables. A program is a .dl file with declarations and rules — you describe what you want, and FlowLog figures out how to compute it.

Here's a complete program in 10 lines:

.decl Edge(src: int32, dst: int32)
.input Edge(IO="file", filename="Edge.csv", delimiter=",")

.decl Reach(node: int32)
.output Reach

Reach(y) :- Edge(1, y).
Reach(y) :- Reach(x), Edge(x, y).

This loads a graph, computes all nodes reachable from node 1, and writes the result. The rest of this section covers how each piece works:

  • Syntax — Variables, constants, comments, and .include.
  • Typesint32, string, f64, and friends.
  • Relations — Declaring data with .decl and wiring up I/O.
  • Rules — The core logic: atoms, joins, and negation.
  • Expressions — Arithmetic, string concatenation, and comparisons.
  • Aggregationmin, max, sum, count, average.
  • User-Defined Functions — Call Rust code from your rules.
  • Extended Semantics — Loop blocks for fine-grained iteration control.