unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Demis Balbach <db@minikn.xyz>, guix-devel@gnu.org
Cc: andrew@trop.in
Subject: Getting tree-sitter grammars in Guix
Date: Sun, 22 Jan 2023 16:38:39 +0100	[thread overview]
Message-ID: <86fsc21sw0.fsf@gmail.com> (raw)
In-Reply-To: <87h6wycn8f.fsf@minikn.xyz>

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


  parent reply	other threads:[~2023-01-22 16:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87h6wycn8f.fsf@minikn.xyz>
2023-01-21 16:43 ` Getting tree-sitter grammars in Guix Katherine Cox-Buday
2023-01-22 15:38 ` Simon Tournier [this message]
2023-02-04 19:27   ` Demis Balbach
2023-02-06 17:25     ` Simon Tournier
2023-02-06 21:01       ` Pierre Langlois
2023-02-07 11:27         ` zimoun
2023-02-08 17:50       ` Demis Balbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86fsc21sw0.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=andrew@trop.in \
    --cc=db@minikn.xyz \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).