Turning Parser Errors into Suggestions for REPL-Driven DSLs (Functional Pearl)
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.
Fri 28 AugDisplayed time zone: Eastern Time (US & Canada) change
11:00 - 12:30 | |||
11:00 30mTalk | Evaluating Shrinking (Experience Report) Haskell Alperen Keles University of Maryland at College Park, George Miao University of Maryland, College Park, Leonidas Lampropoulos University of Maryland at College Park DOI | ||
11:30 30mTalk | Xeus-Haskell: Interactive Haskell Computing in the Browser Haskell Masaya Taniguchi RIKEN AIP | ||
12:00 30mTalk | Turning Parser Errors into Suggestions for REPL-Driven DSLs (Functional Pearl) Haskell Matthías Páll Gissurarson Chalmers University of Technology, Sweden, Elisabet Lobo-Vesga Chalmers University of Technology, Sweden, Alejandro Russo Chalmers University of Technology; University of Gothenburg DOI | ||