With the wide adoption of the language server protocol, the desire to have
IDE-style tooling even for niche and research languages has exploded. The
Truffle language framework facilitates this desire by offering an almost
zero-effort approach to language implementers to providing IDE features.
However, this existing approach needs to execute the code being worked on to
capture much of the information needed for an IDE, ideally with full unit-test
coverage.
To capture information more reliably and avoid the need to execute the code
being worked on, we propose a new parse-based design for language servers. Our
solution provides a language-agnostic interface for structural information,
with which we can support most common IDE features for dynamic languages.
Comparing the two approaches, we find that our new parse-based approach
requires only a modest development effort for each language and has only minor
tradeoffs for precision, for instance for code completion, compared to
Truffle's execution-based approach.
Further, we show that less than 1,000 lines of code capture enough details to
provide much of the typical IDE functionality, with an order of magnitude less
code than ad hoc language servers. We tested our approach for the custom
parsers of Newspeak and SOM, as well as SimpleLanguage's ANTLR grammar without
any changes to it. Combining both parse and execution-based approaches has the
potential to provide good and precise IDE tooling for a wide range of languages
with only small development effort. By itself, our approach would be a good
addition to the many libraries implementing the language server protocol to
enable low-effort implementations of IDE features.
%0 Conference Paper
%1 Marr:2022:LSP
%A Marr, Stefan
%A Burchell, Humphrey
%A Niephaus, Fabio
%B Proceedings of the 18th Symposium on Dynamic Languages
%D 2022
%I ACM
%K Comparison ExecutionTime LanguageServerProtocol MeMyPublication ParseTime myown
%P 14
%R 10.1145/3563834.3567537
%T Execution vs. Parse-Based Language Servers: Tradeoffs and Opportunities for Language-Agnostic Tooling for Dynamic Languages
%X With the wide adoption of the language server protocol, the desire to have
IDE-style tooling even for niche and research languages has exploded. The
Truffle language framework facilitates this desire by offering an almost
zero-effort approach to language implementers to providing IDE features.
However, this existing approach needs to execute the code being worked on to
capture much of the information needed for an IDE, ideally with full unit-test
coverage.
To capture information more reliably and avoid the need to execute the code
being worked on, we propose a new parse-based design for language servers. Our
solution provides a language-agnostic interface for structural information,
with which we can support most common IDE features for dynamic languages.
Comparing the two approaches, we find that our new parse-based approach
requires only a modest development effort for each language and has only minor
tradeoffs for precision, for instance for code completion, compared to
Truffle's execution-based approach.
Further, we show that less than 1,000 lines of code capture enough details to
provide much of the typical IDE functionality, with an order of magnitude less
code than ad hoc language servers. We tested our approach for the custom
parsers of Newspeak and SOM, as well as SimpleLanguage's ANTLR grammar without
any changes to it. Combining both parse and execution-based approaches has the
potential to provide good and precise IDE tooling for a wide range of languages
with only small development effort. By itself, our approach would be a good
addition to the many libraries implementing the language server protocol to
enable low-effort implementations of IDE features.
@inproceedings{Marr:2022:LSP,
abstract = {With the wide adoption of the language server protocol, the desire to have
IDE-style tooling even for niche and research languages has exploded. The
Truffle language framework facilitates this desire by offering an almost
zero-effort approach to language implementers to providing IDE features.
However, this existing approach needs to execute the code being worked on to
capture much of the information needed for an IDE, ideally with full unit-test
coverage.
To capture information more reliably and avoid the need to execute the code
being worked on, we propose a new parse-based design for language servers. Our
solution provides a language-agnostic interface for structural information,
with which we can support most common IDE features for dynamic languages.
Comparing the two approaches, we find that our new parse-based approach
requires only a modest development effort for each language and has only minor
tradeoffs for precision, for instance for code completion, compared to
Truffle's execution-based approach.
Further, we show that less than 1,000 lines of code capture enough details to
provide much of the typical IDE functionality, with an order of magnitude less
code than ad hoc language servers. We tested our approach for the custom
parsers of Newspeak and SOM, as well as SimpleLanguage's ANTLR grammar without
any changes to it. Combining both parse and execution-based approaches has the
potential to provide good and precise IDE tooling for a wide range of languages
with only small development effort. By itself, our approach would be a good
addition to the many libraries implementing the language server protocol to
enable low-effort implementations of IDE features.},
acceptancerate = {0.4},
added-at = {2022-10-05T23:51:09.000+0200},
appendix = {https://github.com/smarr/effortless-language-servers},
author = {Marr, Stefan and Burchell, Humphrey and Niephaus, Fabio},
biburl = {https://www.bibsonomy.org/bibtex/2014984ad22cff92156a1fb3e8c487b15/gron},
blog = {https://stefan-marr.de/2022/10/effortless-language-servers/},
booktitle = {Proceedings of the 18th Symposium on Dynamic Languages},
day = 7,
doi = {10.1145/3563834.3567537},
html = {https://stefan-marr.de/papers/dls-marr-et-al-execution-vs-parse-based-language-servers/},
interhash = {3bffab53a75cde0e657f11f73291b980},
intrahash = {014984ad22cff92156a1fb3e8c487b15},
keywords = {Comparison ExecutionTime LanguageServerProtocol MeMyPublication ParseTime myown},
location = {Auckland, New Zealand},
month = {December},
note = {(acceptance rate 40%)},
pages = 14,
pdf = {https://stefan-marr.de/downloads/dls22-marr-et-al-execution-vs-parse-based-language-servers.pdf},
publisher = {ACM},
series = {DLS'22},
timestamp = {2022-10-27T11:44:10.000+0200},
title = {Execution vs. Parse-Based Language Servers: Tradeoffs and Opportunities for Language-Agnostic Tooling for Dynamic Languages},
year = 2022
}