[[!meta title="Writing a Language Server In OCaml for Emacs, fun, and profit"]]
[[!meta copyright="Copyright © 2023 Austin Theriault"]]
[[!inline pages="internal(2023/info/lspocaml-nav)" raw="yes"]]
<!-- Initially generated with emacsconf-publish-talk-page and then left alone for manual editing -->
<!-- You can manually edit this file to update the abstract, add links, etc. --->
# Writing a Language Server In OCaml for Emacs, fun, and profit
Austin Theriault (he/they) - last name prounounced tare -e -o, <mailto:austin@cutedogs.org>
[[!inline pages="internal(2023/info/lspocaml-before)" raw="yes"]]
Recently, while working at Semgrep, Inc. I wrote a language server for our
SAST tool in OCaml:
<https://github.com/returntocorp/semgrep/tree/develop/src/language_server>. I
then added support for it to emacs
<https://github.com/emacs-lsp/lsp-mode/blob/master/clients/lsp-semgrep.el>.
In this talk I plan to go over what LSP is, why it's important, getting
started writing a language server, and supporting a language server in
Emacs.
About the speaker:
Austin Theriault is a software engineer at Semgrep, Inc. working on
their SAST tool Semgrep. In this talk he will cover the Language
Server Protocol, a way to provide language features to an editor, why
it's important to the future of editors, and how someone might go
about writing a server, and how to integrate it with Emacs.
# Discussion
## Questions and answers
- Q:Why not write the LSP server in OCaml? I missed the reasoning to
switch to Rust/etc - performance?
- A: The "stack" (cross-compilation, libraries, etc.) being less
developed than for developing LSP servers in, e.g., TypeScript
- Q: What are the corner cases, limitations, and other issues you
encountered in implementing an LSP server with client in Emacs, that
were surprising?
- A: Multiple, but performance being the big one. Caching
implementation. And then delivery/distribution (doing so
cross-platform given the OCaml tooling, etc.)
[[!inline pages="internal(2023/info/lspocaml-after)" raw="yes"]]
[[!inline pages="internal(2023/info/lspocaml-nav)" raw="yes"]]