Towards Naturalistic EDSLs using Algebraic Effects

by Jonathan Immanuel Brachthäuser

In Workshop for Domain Specific Languages, Design and Implementation (DSLDI), 2017.

This publication is related to the Lexical Effect Handlers research project.


Domain specific programming languages bridge the linguistic and conceptual gap between domain languages and implementation languages. One aspect of bridging the gap is to express the domain specific concepts in a language more natural for the domain experts.

In recent years, in linguistics, concepts from computer science such as effect operations (e.g. shift/reset and continuations in general) have successfully been used to provide compositional models for natural language semantics.

We propose to pick up the old theme of naturalistic DSLs and reevaluate it in the scope of algebraic effects. Building on the insights of linguists, we demonstrate how linguistic features such as anaphora, quantification and implicature can directly be implemented in the Dotty programming language using a library for algebraic effects.

As opposed to ad hoc implementation techniques for naturalistic DSLs, systematically using algebraic effects and \empheffectful syntax leads to programs that exactly communicate the usage of linguistic features in their types, offers improved error reporting and better IDE support.

We believe that effectful syntax opens up a new interesting perspective on the design and implementation of naturalistic DSLs.