emacs-devel
[Top][All Lists]
Advanced

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

Re: cc-mode fontification feels random


From: Daniel Colascione
Subject: Re: cc-mode fontification feels random
Date: Fri, 11 Jun 2021 13:37:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 6/11/21 1:27 PM, Stefan Monnier wrote:

For what I know about tree-sitter it does not provide the parsers with
the library.
Of course, not, how could it?  There's a never-ending stream of
programming languages out there.

I don't see why you think that's a problem,

It's not just licensing.

Another problem with stock tree-sitter is that it makes Emacs less self-hosting. Tree-sitter grammars are written in JavaScript. You don't need JavaScript to use a grammar, but you do need JavaScript to customize a grammar. In addition, Tree-sitter compiles these JavaScript grammars to C. To use a customized grammar, an Emacs user would have to run node.js (or equally capable JS environment), generate C code, compile that C code, and load it into Emacs as a module. That's a big departure from the traditional approach to Emacs customization.

These technical choices on the part of the Tree-sitter people are unfortunate. I'd prefer an elisp reimplementation of the Tree-sitter algorithms, but I doubt we're going to get that any time soon.

Maybe Tree-sitter could be changed to generate an elisp parser and compile parsers in a lightweight JS environment like Duktape.




reply via email to

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