Abstract
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
10 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Total Type Error Localization and Recovery with Holes;Proceedings of the ACM on Programming Languages;2024-01-05
2. On the Suitability of LSP and DAP for Domain-Specific Languages;2023 ACM/IEEE International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C);2023-10-01
3. A text-based syntax completion method using LR parsing and its evaluation;Science of Computer Programming;2023-06
4. Live Pattern Matching with Typed Holes;Proceedings of the ACM on Programming Languages;2023-04-06
5. An Integrative Human-Centered Architecture for Interactive Programming Assistants;2022 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC);2022-09-12