Software Engineering
FlowLog Compiler Bridges Efficiency and Flexibility in Static Code Analysis
A new Datalog compiler addresses the longstanding trade-off between speed and adaptability in static analyzers by leveraging differential dataflow techniques.
Researchers have introduced FlowLog, a Datalog compiler designed to resolve a persistent challenge in static program analysis: the need to balance computational speed with the ability to customize and extend analysis rules.
The Core Problem#
Static analyzers built with Datalog—a logical programming language popular for this task—typically force developers to choose between two competing priorities. Existing engines either prioritize raw speed at the cost of inflexibility, or offer extensibility while sacrificing performance. In real-world development workflows, neither extreme is satisfactory. Analysts routinely need to refine input data, adjust analysis rules, track down performance bottlenecks, and incorporate analysis techniques that fall outside standard Datalog's capabilities, often requiring manual workarounds or fundamental rewrites to the analysis engine itself.
How FlowLog Works#
FlowLog transforms Datalog programs written in Soufflé style into executable code based on Differential Dataflow, a computation model designed for both efficiency and incremental updates. The approach delivers measurable advantages: across 24 real-world analysis benchmarks, FlowLog consistently outperforms competing state-of-the-art engines in execution speed while maintaining modest memory footprints and demonstrating superior scalability.
Interactive Capabilities#
The system was demonstrated using a DOOP points-to analysis—a classic program analysis technique. The demonstration showcases three key strengths:
- Incremental evaluation: Users can switch seamlessly from one-shot to incremental mode, retracting a single fact and observing analysis results update in milliseconds rather than requiring full recomputation
- Performance profiling: A browser-based profiler reveals per-operator costs, enabling developers to identify and repair inefficient join orderings and other bottlenecks
- Beyond-standard semantics: Users can extend the analysis with extensions like k-core computation, which lies outside the scope of traditional Datalog
This combination addresses the gap between theoretical elegance and practical necessity in static analysis tooling.