Replies: 1 comment 12 replies
-
Unacceptable for Neovim. (I applaud your enthusiasm, but it would be a good idea to spend some time learning about the landscape and previous discussions on this topic -- both of which are quite complex -- first, to save everybody some time.) The main thing is binary distribution for a (very!) wide range of platforms and architectures (and hosts), ideally without requiring any external toolchain locally. (The "editor usage" is a red herring; that part is already pretty much figured out.) There's basically three choices:
|
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Distributing pre-generated parse tables uses much more bandwidth and hosting resources than the grammar and scanner files themselves.
Currently, the "clone and build" distribution method expects clients to have the tree-sitter CLI as well as a C toolchain. We could either remove all dependencies by distributing .wasm/.so (#730), or conversely expect a JS runtime (#2403) and greatly reduce download sizes (this would have savings increasing in the number of languages, whereas the cost is fixed). Or we could support both.
Rudimentary package management would contribute:
langname-src-langversion-abiversion.tar.gz
- smallestgrammar.js
,scanner.o
(not technically "source", but maybe opens up to people writing in Zig/etc; must have no external dependencies), maybe*.scm
langname-wasm-langversion-abiversion.tar.gz
- most portable without needing build toolchainlangname-arch-triple-langversion-abiversion.tar.gz
- fastest without needing build toolchainparser.c
- it's even bigger than.so
while requiring external dependency to buildgrammar.json
is >100x smaller thanlean.so
and >500x smaller thanparser.c
src
andjson
formats is that thetree-sitter
runtime library is in C, but the generation stuff is in Rust?$TS_PARSER_PATH/$TS_MAJOR_VERSION
)No ambition for a standard registry yet.
Very rough sketch
API
CLI
Editor/Plugin Usage
ts__install_from_url
wheneverts__resolve_alias
returnsNULL
:TSInstall
/:TSForceInstall
wrappingts__install_from_url
, supplying lookup table from language name to URLTSLanguage
much like how they are using now. Thetree-sitter
library's resolution mechanism will only returnTSLanguage
s that it's compatible with.python
is too generic an alias for a global install, an alias likenvim-python
orhelix-python
could be usedBeta Was this translation helpful? Give feedback.
All reactions