Merlin: A Language Server for OCaml (Experience Report)

被引:4
|
作者
Bour, Frederic [1 ]
Refis, Thomas [2 ]
Scherer, Gabriel [3 ]
机构
[1] Facebook, Lorraine, France
[2] Jane St, London, England
[3] INRIA, Palaiseau, France
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES | 2018年
关键词
Development environments; language servers; incrementality; incremental parsing; incremental typing; parsing; syntax error recovery;
D O I
10.1145/3236798
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We report on the experience of developing Merlin, a language server for the OCaml programming language in development since 2013. Merlin is a daemon that connects to your favourite text editor and provides services that require a fine-grained understanding of the programming language syntax and static semantics: instant feedback on warnings and errors, autocompletion, "type of the code under the cursor", "go to definition", etc. Language servers need to handle incomplete and partially-incorrect programs, and try to be incremental to minimize recomputation after small editing actions. Merlin was built by carefully adapting the existing tools (the OCamllex lexer and Menhir parser generators) to better support incrementality, incompleteness and error handling. These extensions are elegant and general, as demonstrated by the interesting, unplanned uses that the OCaml community found for them. They could be adapted to other frontends - in any language. Besides incrementality, we discuss the way Merlin communicates with editors, describe the design decisions that went into some demanding features and report on some of the non-apparent difficulties in building good editor support, emerging from expressive programming languages or frustrating tooling ecosystems. We expect this experience report to be of interest to authors of interactive language tooling for any programming language; many design choices may be reused, and some hard-won lessons can serve as warnings.
引用
收藏
页数:15
相关论文
共 50 条
  • [1] Merlin: A Language Server for OCaml (Experience Report)
    Bour, Frederic
    Refis, Thomas
    Scherer, Gabriel
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [2] Experience Report: OCaml for an Industrial-Strength Static Analysis Framework
    Cuoq, Pascal
    Signoles, Julien
    Baudin, Patrick
    Bonichon, Richard
    Canet, Geraud
    Correnson, Loic
    Monate, Benjamin
    Prevosto, Virgile
    Puccetti, Armand
    ICFP'09: PROCEEDINGS OF THE 2009 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2009, : 281 - 286
  • [3] Experience Report: OCaml for an Industrial-Strength Static Analysis Framework
    Cuoq, Pascal
    Signoles, Julien
    Baudin, Patrick
    Bonichon, Richard
    Canet, Geraud
    Correnson, Loic
    Monate, Benjamin
    Prevosto, Virgile
    Puccetti, Armand
    ACM SIGPLAN NOTICES, 2009, 44 (8-9) : 281 - 286
  • [4] Typed Embedding of a Relational Language in OCaml
    Kosarev, Dmitrii
    Boulytchev, Dmitry
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2018, (285): : 1 - 22
  • [5] Automated Server Testing: an Industrial Experience Report
    Peng, Chao
    Gao, Yujun
    Yang, Ping
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022), 2022, : 519 - 522
  • [6] Hardware Implementation of OCAML Using a Synchronous Functional Language
    Sylvestre, Loic
    Serot, Jocelyn
    Chailloux, Emmanuel
    PRACTICAL ASPECTS OF DECLARATIVE LANGUAGES, PADL 2024, 2023, 14512 : 151 - 168
  • [7] The MERLIN corpus: Learner language and the CEFR
    Boyd, Adriane
    Hana, Jirka
    Nicolas, Lionel
    Meurers, Detmar
    Wisniewski, Katrin
    Abel, Andrea
    Schoene, Karin
    Stindlova, Barbora
    Vettori, Chiara
    LREC 2014 - NINTH INTERNATIONAL CONFERENCE ON LANGUAGE RESOURCES AND EVALUATION, 2014, : 1281 - 1288
  • [8] Merlin: A Language for Managing Network Resources
    Soule, Robert
    Basu, Shrutarshi
    Marandi, Parisa Jalili
    Pedone, Fernando
    Kleinberg, Robert
    Sirer, Emin Gun
    Foster, Nate
    IEEE-ACM TRANSACTIONS ON NETWORKING, 2018, 26 (05) : 2188 - 2201
  • [9] Merlin: A Language for Provisioning Network Resources
    Soule, Robert
    Basu, Shrutarshi
    Marandi, Parisa Jalili
    Pedone, Fernando
    Kleinberg, Robert
    Sirer, Emin Gun
    Foster, Nate
    PROCEEDINGS OF THE 2014 CONFERENCE ON EMERGING NETWORKING EXPERIMENTS AND TECHNOLOGIES (CONEXT'14), 2014, : 213 - 225
  • [10] The Merlin Control Language for strategic optimization
    Papageorgiou, DG
    Demetropoulos, IN
    Lagaris, IE
    COMPUTER PHYSICS COMMUNICATIONS, 1998, 109 (2-3) : 250 - 275