Talk: 13:00–13:45 (English)
When Type Checking Goes Wrong, but Keeps Going
An interactive editing environment for a programming language closely resembles the front-end of its compiler. Merlin, the recommended Language Server for OCaml[1], therefore embeds a modified copy of the OCaml front-end. Unlike a compiler, which analyzes complete and syntactically valid programs, an editor continuously operates on incomplete programs that are temporarily inconsistent or ill-typed. To bridge this gap, Merlin relies on two recovery mechanisms. Parsing Recovery synthesizes AST nodes that allow parsing to continue after syntax errors, while Typing Recovery synthesizes typed AST nodes that allow type checking to continue after type errors. These mechanisms are currently implemented as a collection of patches maintained on top of each supported version of the OCaml type-checker.
This presentation describes the work that led to the integration of the Typing Recovery mechanism directly into the OCaml type-checker, in order to reduce divergence between Merlin and the compiler, simplify code maintenance, and align their evolution cycles.
Xavier Van de Woestyne
‘@xvw@merveilles.town, @xvw.lol, @vdwxv
I am an OCaml Senior Software Engineer at Tarides working in the Editor team, especially on OCaml, (on Merlin and OCaml LSP and I maitain the Emacs mode for OCaml). I a m very interested in Functional Programming, type system and Languages tooling.
I have a website : https://xvw.lol