LSP, DAP protocols for language and debugger support

As an FYI to the OCaml community:

Microsoft has for some time been pushing a standardized protocol for language servers (of which Merlin is an example), called (appropriately enough) the Language Server Protocol. The notion behind the LSP is to allow any editor to be a good IDE for any language provided that a language server exists for the language and that it (and the editor) both speak the LSP. LSP has taken off very quickly; there’s now reasonable emacs, vim, vscode, etc. support for it.

It appears Microsoft is now also in the process of creating a new protool called the Debug Adapter Protocol, which works to allow any editor or IDE to interface with any language specific debugger, provided both implement the protocol.

It might be nice if, over the long run, OCaml’s tooling took advantage of the growing ecosystem these protocols provide. I recognize that this probably cannot happen very quickly, but it certainly is something interested people in the community should be aware of.

5 Likes

A LSP implementation for OCaml already exists:

1 Like

There are (at least) 3 LSP implementation for ocaml/reason actually:

Yes, and there’s the Earlybird debug adapter. But so far as I can tell, these tools are not in wide use. It would probably be a good thing if, over time, using LSP and DAP became the default way that Merlin and the debuggers were interfaced to editors. (This might require some extensions to the protocols.)

I think both LSP and DAP implementations of OCaml could be a part of platform: Creating OCaml Platform

A good example could be creating something like Juno - Julia IDE based on top of the Atom, with all shenanigans installed.