[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using incremental parsing in Emacs (via: emacs rendering comparisson
From: |
Tuấn Anh Nguyễn |
Subject: |
Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3) |
Date: |
Mon, 30 Mar 2020 20:43:08 +0700 |
> The existing third party packages should be good starting points to come
> up with a design. But I think an important issue is to figure out how
> to make tree-sitter usable for the end users: AFAICT the main issue
> being how to let end users download and install new grammars.
> IIUC grammars are written in Javascript (or some subset thereof?) and
> then somehow compiled to C code. Having them as C code implies either
> the end-user need to have a C compiler or distributing pre-compiled
> binaries with all the trouble this entails (with all the variations of
> OSes, and architectures, and ABIs, ..., plus issues related to
> licensing, security, ...).
In the short term, I think the practical approach would be distributing
pre-compiled binaries for major targets, and providing users with enough
tooling to compile on other targets. Licensing and security are a
different matter.
> Maybe those grammars could be compiled to some other representation (I
> don't know if it is made mostly of data-tables or actual code or what)?
Many of those grammars have parts of the lexer in custom C code.
Therefore, a common representation would require an instruction set. In
principle, that can be done with something like WebAssembly. Tree-sitter
already compiles to WebAssembly (both the runtime and the grammars). Its
playground uses that:
https://tree-sitter.github.io/tree-sitter/playground.
--
Tuấn-Anh Nguyễn
Software Engineer
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), (continued)
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Alan Third, 2020/03/31
- Re: Reliable after-change-functions (via: Using incremental parsing in Emacs), Eli Zaretskii, 2020/03/31
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Stefan Monnier, 2020/03/29
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Eli Zaretskii, 2020/03/30
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Stefan Monnier, 2020/03/30
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Eli Zaretskii, 2020/03/30
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Stefan Monnier, 2020/03/30
- Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3), Stephen Leake, 2020/03/31
Re: Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3),
Tuấn Anh Nguyễn <=