emacs-devel
[Top][All Lists]
Advanced

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

Re: Tree-sitter introduction documentation


From: Philip Kaludercic
Subject: Re: Tree-sitter introduction documentation
Date: Tue, 27 Dec 2022 16:44:02 +0000

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> It doesn't need any project, it is literally two command lines.
>> Here's an example:
>>
>>   gcc -O2 -I.   -c -o parser.o parser.c
>>   gcc  -shared parser.o scanner.o  -ltree-sitter -o 
>> libtree-sitter-c-sharp.dll
>
> AFAIK `parser.c` is a file generated from the actual grammar's source,
> itself written in Javascript.
>
> So the above instructions are akin to downloading a precompiled binary
> and installing it.  While it is the most convenient path for the
> end-users, it's important w.r.t Freedom to make sure that grammars can
> also be regenerated from source by the end users.

I have asked the question before, but freedom or not, the above is a
nuisance to run for every language.  If the process is as automatic as
the above example demonstrates, shouldn't Emacs have a command to take a
grammar and compile+install it?  I guess this could be more complicated
if the grammar is generated using a custom tool-chain for each language
(or is it always Javascript?), but nothing impossible.

What would be even better is if the grammars were to be distributed
along with Emacs (either in a tarball or as a dependency a package
manage would install).



reply via email to

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