[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Getting tree-sitter grammars in Guix
From: |
Simon Tournier |
Subject: |
Getting tree-sitter grammars in Guix |
Date: |
Sun, 22 Jan 2023 16:38:39 +0100 |
Hi,
On Tue, 10 Jan 2023 at 18:29, Demis Balbach <db@minikn.xyz> wrote:
> Hello, I was wondering what the "correct" way would be to get grammars
> for the tree-sitter library available in Guix when using tree-sitter
> with Emacs 29+.
This raises a question about the bootstrap.
>From my understanding, the inputs of Tree-sitter is the file
’grammar.js’ and then using Node.js, it generates C files. It is often
these C files which are considered as the Tree-sitter parser.
Many Tree-sitter parsers are available [1]. For example, Bash [2]. The
grammar is described by ’grammar.js’ [3] and then using it, the file
’src/parser.c’ [4] is generated (note the size 3.46MB!). Then, using
this file ’src/parser.c’ is generated a library which is called by the
editor tool (say Emacs tree-sitter [5]).
I am not aware if someone has tried to rebuild using Guix only from the
grammar.js to a working tree-sitter editing experience.
Well, considering the state of Node.js and Guix, it appears to me
difficult to debootstrap. And maybe, we should accept a large
unverified seed for Tree-sitter. Well, I do not know.
What people think? What do we do with Tree-sitter?
1: <https://tree-sitter.github.io/tree-sitter/>
2: <https://github.com/tree-sitter/tree-sitter-bash>
3: <https://github.com/tree-sitter/tree-sitter-bash/blob/master/grammar.js>
4: <https://github.com/tree-sitter/tree-sitter-bash/blob/master/src/parser.c>
5: <https://emacs-tree-sitter.github.io/>
Cheers,
simon