emacs-devel
[Top][All Lists]
Advanced

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

Re: PL support


From: Daniel Colascione
Subject: Re: PL support
Date: Sat, 9 May 2020 12:28:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/9/20 12:01 PM, Dmitry Gutov wrote:
On 09.05.2020 21:41, Daniel Colascione wrote:
TreeSitter requires NPM for customization and compiles to C, right? I don't want people to require either to customize Emacs. Why not just port the tree sitter parser generator to elisp?

You might want to pop to the previous discussion of TreeSitter on this mailing list.

I made these points there already, you're welcome to read the responses.

I should go back and reread that. (I declared emacs-devel unread email bankruptcy recently.)

Bottom line is: if someone implements this, we can talk.

Does anyone need to implement it? Looking at TreeSitter's repository, it looks like the parser generator itself is written in Rust (which could be linked directly into Emacs), the JS-specific grammar bit is pretty small and directly translatable to elisp [1], and the output of the parser generator is a bunch of tables that could, in principle, be used directly instead of having to round-trip through a C compiler.

If TreeSitter works as well as described, it'd be worth just making it a build requirement for Emacs so that --- at long last --- the core modes could be grammar-based. Doing that would require ditching platforms that Rust doesn't support, but I'm okay with that. It looks technically doable.

Sure, integrating TS this way would require taking a dependency on LLVM --- at least for the moment, since gccrs is still immature. It'd be a political shift. But is it more important to catch up with the rest of the editingworld or to keep shunning LLVM (which is free software!) for some reason?

[1] https://github.com/tree-sitter/tree-sitter/blob/master/cli/src/generate/dsl.js



reply via email to

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