emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter introduction documentation


From: Gregory Heytings
Subject: Re: Tree-sitter introduction documentation
Date: Wed, 28 Dec 2022 12:56:09 +0000


Good luck with that! It requires to install Node.js and other stiff, which I personally won't touch with a 3-mile pole, and I'm unsure (but never bothered to find out) whether free replacements even exist.

That's the part of Tree-sitter which makes me a bit uneasy.

In Emacs, we usually don't just stick to the letter of the Free Software principles (e.g. release our code under the GPL) but we try to go the extra miles so that our users can actually exercise their rights as easily as possible (e.g. with things like `C-h k` that lets them jump straight to the source, ...).

But with Tree-sitter, our users are currently a bit stuck. The grammars are Free, yes, but it takes a fair bit of extra work (and potentially even some code with unclear licensing along the way) if you want to modify their source code and use the result :-(


I think that's an exaggeration. On a Debian-based system, building a grammar from source is as easy as typing three commands:

$ apt install gcc nodejs rust-all
$ cargo install tree-sitter-cli
$ tree-sitter generate grammar.js

Step 1 installs the necessary tools, all of which are free software (GPL for GCC, MIT for Node.js, dual MIT and Apache for Rust).

Step 2 downloads the source code of tree-sitter and of all its dependencies, and builds tree-sitter. Again it is, and its dependencies are, free software (MIT for tree-sitter, and for its dependencies usually dual MIT and Apache like Rust itself, sometimes BSD or Zlib or public domain).

Step 3 converts the grammar.js file into the parser.c file.

Now you can use GCC to build the library.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]