Publication:

Designing Datalog-Based Embedded Languages

Loading...
Thumbnail Image

Date

2023-06-30

Published Version

Published Version

Journal Title

Journal ISSN

Volume Title

Publisher

The Harvard community has made this article openly available. Please share how this access benefits you.

Research Projects

Organizational Units

Journal Issue

Citation

Zhang, Eric Kangning. 2023. Designing Datalog-Based Embedded Languages. Bachelor's thesis, Harvard College.

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.

Description

Other Available Sources

Research Data

Keywords

Datalog, Rust, Computer science, Mathematics

Terms of Use

This article is made available under the terms and conditions applicable to Other Posted Material (LAA), as set forth at Terms of Service

Endorsement

Review

Supplemented By

Related Stories