> The Tree-sitter parser for Bash itself somehow requires Typescript, though the parser is in C.
You can use tree-sitter to produce nothing more than C parser file that only depends on a very small tree-sitter C library.
So you can use tree-sitter to produce a parser that does not require Typescript.
However, there is whole other side to tree-sitter which is about filtering/manipulating/searching the AST results produced by that C parser and this layer has binding to many languages.
I suspect this Bash LSP project is using the tree-sitter Typescript bindings for their AST processing.
Re:Bash-LSP: A language server for Bash
by nonbirithm on Thursday April 01, 2021 @05:48PM
(#26666543)
> The Tree-sitter parser for Bash itself somehow requires Typescript, though the parser is in C.
This is not necessarily true if you can write a compiler for a tree-sitter grammar that outputs the parser code in your favorite language. I know semgrep does this to make parsers for OCaml. But, of course, that's more work to be done.
It's worse than you think.
This uses something called Tree-sitter: some project written in C for providing parsers for numerous languages.
The Tree-sitter parser for Bash itself somehow requires Typescript, though the parser is in C.
This Bash-LSP project uses a binary blob of that parser: it is C compiled as C++ into WebAssembly.
Bash-LSP, as well as the Tree-sitter Bash parser, can basically be called IDE tooling written by and for TypeScript programmers, who sometimes have to mess with Bash scripts.
The target audience doesn't mind TypeScript and Node dependencies, and in fact likely finds that preferrable to any other kind of dependency, because working with TypeScript dependencies is fresh in their minds, requiring little ramp-up to handle another one.