A Modern Compiler Framework for Datalog
Published in Johannes Gutenberg-Universität Mainz, 2026
Recommended citation: David Klopp. (2026). "A Modern Compiler Framework for Datalog." PhD dissertation, Johannes Gutenberg-Universität Mainz. https://doi.org/10.25358/openscience-16701
We propose MLDL (Multi-Level Datalog), a compiler framework that lets different Datalog dialects share optimizations and target different evaluation engines. At its core is a typed, multi-level intermediate representation that preserves the logical structure of Datalog programs while supporting language extensions and lowering them in stages. We demonstrate this extensibility by integrating OODL, an object-oriented Datalog dialect with side effects. We also develop a framework for analyses that reason across relations and use it to implement constant propagation and termination checking. Finally, we introduce a module system that supports separate compilation and partial linking. To demonstrate reuse across dialects, we combine a Java points-to analysis written in Soufflé with a Functional IncA program to build an escape analysis.
