unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Tuấn Anh Nguyễn" <ubolonton@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <CAOGL6j6Nckr4FJ7d-hrGwJ4tEsJfrzUQatJvmk+7iTS8k=yx=A@mail.gmail.com> (raw)

> 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



             reply	other threads:[~2020-03-30 13:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 13:43 Tuấn Anh Nguyễn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-03-29 18:46 Using incremental parsing in Emacs (via: emacs rendering comparisson between emacs23 and emacs26.3) Stefan Monnier
2020-03-29 19:05 ` Andrea Corallo
2020-03-29 19:18   ` Eli Zaretskii
2020-03-30  3:35     ` Stefan Monnier
2020-03-30  6:02       ` Eli Zaretskii
2020-03-30 13:33         ` Stefan Monnier
2020-03-30 14:09           ` Eli Zaretskii
2020-03-30 15:03             ` Stefan Monnier
2020-04-01  0:39               ` Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOGL6j6Nckr4FJ7d-hrGwJ4tEsJfrzUQatJvmk+7iTS8k=yx=A@mail.gmail.com' \
    --to=ubolonton@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).