A principled approach to REPL interpreters - Archive ouverte HAL Access content directly
Conference Papers Year :

A principled approach to REPL interpreters

(1) , (2) , (3) , (1, 4) , (3) , (3)


Read-eval-print-loops (REPLs) allow programmers to test out snippets of code, explore APIs, or even incrementally construct code, and get immediate feedback on their actions. However, even though many languages provide a REPL, the relation between the language as is and what is accepted at the REPL prompt is not always well-defined. Furthermore, implementing a REPL for new languages, such as DSLs, may incur significant language engineering cost. In this paper we survey the domain of REPLs and investigate the (formal) principles underlying REPLs. We identify and define the class of sequential languages, which admit a sound REPL implementation based on a definitional interpreter , and present design guidelines for extending existing language implementations to support REPL-style interfaces (including computational notebooks). The obtained REPLs can then be generically turned into an exploring interpreter, to allow exploration of the user's interaction. The approach is illustrated using three case studies, based on MiniJava, QL (a DSL for questionnaires), and eFLINT (a DSL for normative rules). We expect sequential languages, and the consequent design principles, to be stepping stones towards a better understanding of the essence of REPLs.
Fichier principal
Vignette du fichier
onward2020-repls.pdf (925.02 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

hal-02968938 , version 1 (16-10-2020)



L. Thomas van Binsbergen, Mauricio Verano Merino, Pierre Jeanjean, Tijs van Der Storm, Benoit Combemale, et al.. A principled approach to REPL interpreters. SPLASH 2020 - ACM SIGPLAN conference on Systems, Programming, Languages, and Applications: Software for Humanity, Nov 2020, Chicago / Virtual, United States. pp.1-17, ⟨10.1145/3426428.3426917⟩. ⟨hal-02968938⟩
657 View
468 Download



Gmail Facebook Twitter LinkedIn More