Turning Parser Errors into Suggestions for REPL-Driven DSLs (Functional Pearl)
Paper in proceeding, 2026

Many of the domain-specific languages we use every day are not written to files but typed at an interactive prompt, e.g., database shells, cloud CLIs, and in-house analytics consoles. For these REPL-driven command languages, autocomplete is, we argue, not a polish feature but a core usability requirement --and yet they are precisely the languages whose authors often have the fewest resources to invest in tooling. Designing a new programming language tailored to specific domain challenges can be both powerful and rewarding. However, a major hurdle for adoption among users is, in our experience, the lack of tooling support, particularly features like autocomplete that enhance usability and reduce the learning curve. In this paper, we present a fresh perspective that turns parser errors -- traditionally seen as roadblocks -- into opportunities for generating valid, context-aware autocomplete suggestions. By leveraging the parser's built-in feedback mechanisms, our method offers a lightweight, adaptable, and simple solution, enabling domain-specific languages to provide basic development assistance with minimal overhead. The technique fits the REPL-driven DSL genre by design: inputs are modest-size single statements, the cursor sits at the end of the line, and parser-error recovery is unnecessary. We apply the technique to DPella DSL, a production REPL-driven DSL whose grammar comprises 43 top-level command constructors, 130 reserved keywords, and 22 labelled syntactic categories that drive identifier completion.

Autocomplete

Suggestions

Domain-Specific Languages

Parsing

REPL

Author

Matthías Páll Gissurarson

DPella AB

Elisabet Lobo Vesga

DPella AB

Alejandro Russo

Chalmers, Computer Science and Engineering (Chalmers), Information Security

Haskell 2026: Proceedings of the ACM SIGPLAN International Haskell Symposium


979-8-4007-2869-3 (ISBN)

ACM SIGPLAN Haskell Symposium
Indianapolis, ,

A Programming Framework for Differential Privacy with Accuracy Calculations

Swedish Research Council (VR) (2020-03881), 2020-12-01 -- 2024-11-30.

Subject Categories (SSIF 2025)

Software Engineering

Computer Systems

Areas of Advance

Information and Communication Technology

DOI

10.1145/3830439.3831275

More information

Latest update

9/6/2026 5