From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jorge Javier Araya Navarro Newsgroups: gmane.emacs.devel Subject: Re: emacs-tree-sitter and Emacs Date: Mon, 30 Mar 2020 11:00:05 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002db7be05a21564dd" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="42736"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 30 19:02:33 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jIxo0-000B11-I4 for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 19:02:32 +0200 Original-Received: from localhost ([::1]:53186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIxnz-0002Ml-Hw for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Mar 2020 13:02:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55695) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIxmH-0008KX-4p for emacs-devel@gnu.org; Mon, 30 Mar 2020 13:00:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIxmF-00040I-OR for emacs-devel@gnu.org; Mon, 30 Mar 2020 13:00:45 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:40014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIxmF-0003zB-BS for emacs-devel@gnu.org; Mon, 30 Mar 2020 13:00:43 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id a81so22808094wmf.5 for ; Mon, 30 Mar 2020 10:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=esavara-cr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0TIjf2x8fugbUrO4OrJ9Cjx9QXHQTOg7gcm0kbhXzso=; b=eqPXLQ/hGFaqXhXBRbvhGNkPWlv/ZIGvR4PyA7pxb5VGiqTAIp6Sv95Y42QafCwyyI Inl0RxbtnjSmF6UtX5sum866a9uDmvJ7xDM3WbN3x5kuhah3n1Xni7m292J2RZlPdSTc pdMBOuFuADGyNAOQtchO3HUeMf/2acHGgK9FIN9ykWExGGKqCWQ0/kXwnZxDjHifQtuN nVDpVX8e5b+DMrLXhCivQlpY9D+YSaY1osiEroGzln7//6i6gaWerULeud3FETxo393h a3sn1N78uRCRR4Nnl+nXX4ca0qnC7OLo2v0y4oN/qKEVIMLRYy1E7gfF2kVmKtOtarxA Vz/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0TIjf2x8fugbUrO4OrJ9Cjx9QXHQTOg7gcm0kbhXzso=; b=I0K6u/wifZ0b0nEHs7oHhl+R7zu9oJyiO5Rto42PZR02ngcN5p+aaZysiEvmGFWT9o bh9Wu5TLJsRdeoJb7NvnfRAEk+NT5xzYGEi7Ha7herVqwG32+/5UOjUfav0Xr58UkNnm BMjWzCn452BqWuLFkShFHVqr8zI5mL9nXV+JXIEPQ96MY1Mc7bn+/ojJZ//Kq3vZlomp EvHI18cMQ6KKdWd8WBygaHEDgHQsCYtJ/Cw2hCmSitHbDUZsz+O4q7B+V/j+Nd76c7Nj 1ECb+jFjRKp3INIo/zS7byta4PuegGNLJQ0fnX0n7q8ASZ9IQA0+MO4PUiEmdINlPIAh sM7g== X-Gm-Message-State: ANhLgQ13zrKk1i6Xe8afBSJGPBUqzZPlT4E40XACkoGiY7uIcTRL4xkZ Ku47hs7P1HV5Gz/eaxItyoV3X1+NkgPWd37IYoBX2A== X-Google-Smtp-Source: ADFU+vtB7dj9Luly89e3PK8WQzXOLDKCVfIYzZgpmzkJKimYFyxxyvr+jyQRA8b+bOaVSSGbz3kBWfvx9Ob5cgLU7ME= X-Received: by 2002:a1c:dd8b:: with SMTP id u133mr204237wmg.109.1585587642277; Mon, 30 Mar 2020 10:00:42 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246030 Archived-At: --0000000000002db7be05a21564dd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see, so in your opinion having a central engine won't be a bad architecture design for Emacs despite major modes having their own engine. I wonder: is possible for any other package to "take the wheel" from major modes when it comes to indentation or a better approach would be offering facilities for package authors and maintainers to outsource their indentation to this central tree-sitter-based indentation engine? I'm trying to picture how this would look like. El lun., 30 de mar. de 2020 a la(s) 08:11, Stefan Monnier ( monnier@iro.umontreal.ca) escribi=C3=B3: > > First off, in the issue tracker we have a ticket open for making this > > project available on GNU ELPA, Ubolonton seems willing to make that > > a reality > > That would be neat. > > > but this package has some special requirements that would make > > impossible to submit it to GNU ELPA or MELPA, for instance, we need to > > ship with grammars for some languages that require compiling and AFAIK > > there is no way to build external dependencies in *ELPA.[1] > > Indeed, the GNU ELPA infrastructure is too weak to support such a thing > right now, but that's a problem we need to fix anyway, so it just means > we should work on it. > > > Finally, I'm planning to tackle indentation for my next pull request. > > It come as a surprise that Emacs has no "central" indentation engine > > but that instead each major mode ships with its own indentation > > engine. > > It's not so surprising if you think about it: indentation requires > parsing, so "a central indentation engine" requires something like > tree-sitter ;-) > > SMIE is the closest there is so far (contrary to tree-sitter it uses > a very simple parsing strategy, which is just barely sufficient for > "typical" indentation cases). > > CC-mode has another engine, which is used for several languages. > > And finally, there's `wisi` on GNU ELPA, it aims to be very generic and > pretty flexible, but AFAIK it's only used by `ada-mode` so far. > > > Stefan > > --0000000000002db7be05a21564dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I see, so in your opinion having a central engine won't be a bad arc= hitecture design for Emacs despite major modes having their own engine.

I wonder: is pos= sible for any other package to "take the wheel" from major modes = when it comes to indentation or a better approach would be offering facilit= ies for package authors and maintainers to outsource their indentation to t= his central tree-sitter-based indentation engine?

I'm trying to picture how this wou= ld look like.

El lun., 30 de mar. de 2020 a la(s) 08:11, Stefan Mo= nnier (monnier@iro.umontreal.ca= ) escribi=C3=B3:
> First off, in the issue tracker we have a ticket open for making = this
> project available on GNU ELPA, Ubolonton seems willing to make that > a reality

That would be neat.

> but this package has some special requirements that would make
> impossible to submit it to GNU ELPA or MELPA, for instance, we need to=
> ship with grammars for some languages that require compiling and AFAIK=
> there is no way to build external dependencies in *ELPA.[1]

Indeed, the GNU ELPA infrastructure is too weak to support such a thing
right now, but that's a problem we need to fix anyway, so it just means=
we should work on it.

> Finally, I'm planning to tackle indentation for my next pull reque= st.
> It come as a surprise that Emacs has no "central" indentatio= n engine
> but that instead each major mode ships with its own indentation
> engine.

It's not so surprising if you think about it: indentation requires
parsing, so "a central indentation engine" requires something lik= e
tree-sitter ;-)

SMIE is the closest there is so far (contrary to tree-sitter it uses
a very simple parsing strategy, which is just barely sufficient for
"typical" indentation cases).

CC-mode has another engine, which is used for several languages.

And finally, there's `wisi` on GNU ELPA, it aims to be very generic and=
pretty flexible, but AFAIK it's only used by `ada-mode` so far.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--0000000000002db7be05a21564dd--