Merlin: A Language Server for OCaml (Experience Report)

07/17/2018
by   Frédéric Bour, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/31/2018

Deep Reinforcement Learning for Programming Language Correction

Novice programmers often struggle with the formal syntax of programming ...
research
03/27/2018

Lolisa: Formal Syntax and Semantics for a Subset of the Solidity Programming Language

This article presents the formal syntax and semantics for a large subset...
research
04/03/2020

Interpreted Programming Language Extension for 3D Render on the Web

There are tools to ease the 2D/3D graphics development for programmers. ...
research
11/03/2022

Revisiting Language Support for Generic Programming: When Genericity Is a Core Design Goal

Context: Generic programming, as defined by Stepanov, is a methodology f...
research
11/19/2021

Types for Tables: A Language Design Benchmark

Context: Tables are ubiquitous formats for data. Therefore, techniques f...
research
04/09/2023

Dependently Typing R Vectors, Arrays, and Matrices

The R programming language is widely used in large-scale data analyses. ...
research
03/07/2023

Real-World Choreographic Programming: An Experience Report

Choreographic programming is a programming paradigm, whereby the overall...

Please sign up or login with your details

Forgot password? Click here to reset