Publication: Designing Datalog-Based Embedded Languages
Open/View Files
Date
Authors
Published Version
Published Version
Journal Title
Journal ISSN
Volume Title
Publisher
Citation
Abstract
Datalog is a declarative, domain-specific programming language grounded in principles of logic. At its essence, it expresses computation on relational data in a manner that is both understandable by humans and easy for machines to reason about.
Although it was originally introduced in the 1980s as a subset of Prolog, Datalog has seen a resurgence in a wide variety of modern software applications such as databases, rule engines for security, static analysis frameworks, and authorization. In these cases, the basic semantics of the language are well-established, but its precise syntax and evaluation as a domain-specific language are usually tailored to the application. This opens up exciting possibilities for language design to impact the way people express computational ideas.
To explore the strengths and limitations of Datalog, we design and implement two language systems with Datalog at their core, addressing distinct computer science domains. First, we create a high-performance Datalog implementation in Rust, seamlessly integrate it with the host language, and demonstrate that cross-language function calls are possible. Second, we explore the seldom-examined connection between Datalog and data analysis by creating a reactive web-based notebook programming environment, offering a tangible, reproducible, and easily shareable platform for exploration of datasets.
In both cases, we construct the designed system—either as a prototype or a production-ready library—and present case studies on industry or other real-world usage. Additionally, we benchmark and holistically evaluate the systems to demonstrate how our design choices in embedding Datalog can enhance language interface usability and expressiveness, while also discussing drawbacks and limitations.