summaryrefslogtreecommitdiffstats
path: root/2023/talks/lspocaml.md
blob: 7646c7b58eabf7a71166d2ae4879e14334908c42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[[!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"]]