unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca, theophilusx@gmail.com, emacs-devel@gnu.org
Subject: Re: Tree-sitter introduction documentation
Date: Tue, 27 Dec 2022 16:11:22 +0200	[thread overview]
Message-ID: <71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru> (raw)
In-Reply-To: <83pmc50xxc.fsf@gnu.org>

On 27/12/2022 15:38, Eli Zaretskii wrote:
>> Date: Tue, 27 Dec 2022 14:43:06 +0200
>> Cc: monnier@iro.umontreal.ca, theophilusx@gmail.com, emacs-devel@gnu.org
>> From: Dmitry Gutov <dgutov@yandex.ru>
>>
>>> WDYT about what we have in NEWS about this?
>>
>> Those instructions seem to be written foremost with distro maintainers
>> in mind.
> 
> Or users who build and install Emacs by themselves.
> 
> Frankly, I don't see why we, the upstream project, need to worry about
> anyone else.  It isn't our job.  That's what distros are there for.

Previously all one needed for a language support mode is to download and 
load an .el file. As we drift to the idea of using externally-maintained 
grammars, and the "native" modes become less useful (possibly deprecated 
in 5-10), it seems like it will become more of our responsibility to 
streamline.

>> Definitely better to have them than not, but I'd hate to present
>> them to the average user.
> 
> "Hate"?  That's a strong word.

Also a figure of speech.

> The questions that the NEWS entries
> answer were asked here and elsewhere several times, so presumably that
> information has some non-trivial value.

Of course.

>> Do we expect all (most?) distros to compile all the popular grammars?
> 
> I honestly don't know.  On the one hand, there aren't many Emacs modes
> which use tree-sitter, but OTOH they could start growing like
> mushrooms once Emacs 29 hits the streets.  I do expect them to offer
> the ones they consider useful/needed, for some value of that.  I
> really don't see any significant difference in this regard between
> grammar libraries and, say, librsvg.  Both are used in Emacs, and the
> lack of either disables useful Emacs features.  So it's a no-brainer
> for me.  But then I'm not a distro maintainer, and never have been.

On the flip side, the third-party modes can provide their own 
download-compile-install instructions, which will make it easier to end 
users.

The barrier to creating such a mode, though, is now higher.

>> That would still leave out the users of the less popular languages whose
>> grammars were not included. Or grammars which saw updates since the
>> distro-distributed version (so it's useful to install the newer version).
> 
> What's the solution?  All the "solutions" I saw until now require a
> working and well-configured C/C++ compiler (sometimes both C and C++),
> linker, and C/C++ runtimes.  A user who has them already installed can
> easily build a grammar library with two simple commands.  A user who
> doesn't have a C/C++ development environment will not find those
> "solutions" useful at all.  And asking us to distribute binaries for
> half a dozen popular systems is IMNSHO unreasonable.

I think it's common enough for a user to have build tools installed, but 
not know well enough how to set up a C project. Think junior-middle 
developers in a number of languages which are not C.

Or just first grade students.

>> I wouldn't worry too much about the maintenance burden (keeping the list
>> of urls up-to-date?), especially since we could refer to such lists by
>> other projects.
> 
> I cannot disagree more.  Look at this from my POV: once the list
> becomes even semi-official, people will expect it to be of the same
> high quality as all the rest of Emacs, and they _will_ complain and
> report inaccuracies.  It's a nuisance, especially for such a "hot"
> feature set.

They will report inaccuracies, which will be helpful to fixing them. 
That is certainly a workload, but still small compared to the current 
flow of bug reports, I think. Or the many hours one would spend fixing a 
font- or redisplay-related problem.

Anyway, my point was not to put this burden on you specifically. If you 
might recall, I've always advocated toward "smaller core with many 
plugins" as a model of Emacs development.

> And which "other projects"? who can track those and know which ones
> have the most accurate, up-to-date, and comprehensive list?  I'm a bit
> interested in this (and have several dozens of grammar libraries built
> locally), and I discover another project with a useful list of
> grammars almost every day.  These things are highly dynamic: I see
> some of the grammars get updates every couple of days.  Some languages
> have more than one grammar library maintained by different people --
> who will figure out which one is better for us and keep that
> information up-to-date?

The Neovim repo will likely be a good resource for this in the near 
future. This file in particular: 
https://github.com/nvim-treesitter/nvim-treesitter/blob/f2b1d727e6ad46238baa84c4d1f968a297e415ab/lua/nvim-treesitter/parsers.lua

But it brings me to another concern, showcased by this commit: 
https://github.com/nvim-treesitter/nvim-treesitter/commit/0cb637ca9f4389172933e5aba36387ab8430b6fb

The AST for one version of a grammar might be incompatible enough with a 
newer one, making the TS queries, font-lock and indentation rules 
obsolete or at least slightly broken. nvim-treesitter works around this 
by locking the repository version of a grammar corresponding to the 
current language support code.

How much this will be a problem in practice for us? I'm not sure. 
Perhaps most popular grammars have had enough time to mature by now.

>> I think ELPA is a better place for this feature, though. Because we
>> always want the user to get the latest version of the recipes.
> 
> That solves only part of the problem.  (And not an important part: our
> Git repository is public, so people can track it and download updates
> for files as easily as they track ELPA.)

One is not exactly like the other from an end user's POV.

> The hard part -- keeping the
> information accurate and up-to-date -- still needs a motivated
> volunteer.  And we hardly have resources to work on our code and docs,
> let alone help people install external software.
> 
> (Of course, if such a motivated volunteer steps forward, he or she
> will be most welcome.)

My guess is we have a few people here already who might be interested.



  reply	other threads:[~2022-12-27 14:11 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 14:47 Tree-sitter introduction documentation Perry Smith
2022-12-16 15:06 ` Eli Zaretskii
2022-12-16 15:24   ` João Távora
2022-12-16 15:36     ` Perry Smith
2022-12-16 15:43       ` João Távora
2022-12-16 17:56       ` Philip Kaludercic
2022-12-16 15:38     ` Eli Zaretskii
2022-12-16 15:48       ` João Távora
2022-12-16 15:53         ` Perry Smith
2022-12-16 16:02           ` João Távora
2022-12-18  9:59             ` Eli Zaretskii
2022-12-18 14:07               ` Perry Smith
2022-12-18 17:18                 ` Eli Zaretskii
2022-12-16 16:34         ` Eli Zaretskii
2022-12-17  0:03           ` Tim Cross
2022-12-17  8:42             ` Eli Zaretskii
2022-12-17 10:40               ` João Távora
2022-12-17 11:00                 ` Eli Zaretskii
2022-12-18  0:40               ` Tim Cross
2022-12-16 16:01       ` Manuel Giraud
2022-12-16 16:40         ` Eli Zaretskii
2022-12-16 16:47           ` Perry Smith
2022-12-16 17:21             ` Eli Zaretskii
2022-12-16 15:53     ` Manuel Giraud
2022-12-16 15:56       ` João Távora
2022-12-16 16:39       ` Eli Zaretskii
2022-12-16 17:15         ` Manuel Giraud
2022-12-16 17:23           ` Eli Zaretskii
2022-12-16 20:22             ` Ken Brown
2022-12-17  4:06               ` Tim Cross
2022-12-17 15:42                 ` Stefan Monnier
2022-12-17 17:41                   ` T.V Raman
2022-12-26 22:42                   ` Dmitry Gutov
2022-12-27 12:11                     ` Eli Zaretskii
2022-12-27 12:43                       ` Dmitry Gutov
2022-12-27 13:38                         ` Eli Zaretskii
2022-12-27 14:11                           ` Dmitry Gutov [this message]
2022-12-27 14:32                             ` Eli Zaretskii
2022-12-27 16:36                               ` Stefan Monnier
2022-12-27 16:44                                 ` Philip Kaludercic
2022-12-27 17:16                                   ` Eli Zaretskii
2022-12-27 17:20                                     ` Philip Kaludercic
2022-12-27 18:06                                       ` Eli Zaretskii
2022-12-27 17:33                                     ` Stefan Monnier
2022-12-30 11:06                                   ` Yuan Fu
2022-12-30 11:25                                     ` Philip Kaludercic
2022-12-30 11:54                                       ` tomas
2022-12-30 11:59                                         ` Philip Kaludercic
2022-12-30 12:27                                           ` tomas
2022-12-30 12:45                                             ` Philip Kaludercic
2022-12-30 14:26                                             ` Dmitry Gutov
2022-12-30 23:33                                       ` Yuan Fu
2022-12-30 15:31                                     ` Eli Zaretskii
2022-12-30 15:54                                       ` Philip Kaludercic
2022-12-30 16:17                                         ` Eli Zaretskii
2022-12-31  0:06                                         ` Yuan Fu
2022-12-31  0:12                                           ` Philip Kaludercic
2023-01-01  1:18                                             ` Yuan Fu
2023-01-02 19:10                                               ` [SPAM UNSURE] " Stephen Leake
2022-12-31  0:03                                       ` Yuan Fu
2022-12-31  0:25                                         ` Stefan Monnier
2023-01-01  1:16                                           ` Yuan Fu
2023-01-01  6:39                                             ` Eli Zaretskii
2023-01-02  0:31                                               ` Yuan Fu
2023-01-02  0:40                                                 ` Stefan Monnier
2023-01-03  6:58                                                   ` Yuan Fu
2023-01-02  3:34                                                 ` Eli Zaretskii
2022-12-31  9:24                                         ` Eli Zaretskii
2022-12-31 22:14                                           ` Yuan Fu
2023-01-01  1:12                                             ` Yuan Fu
2022-12-31  0:44                                       ` Gregory Heytings
2023-01-03  4:08                                       ` Richard Stallman
2023-01-03 12:14                                         ` Eli Zaretskii
2023-01-01  3:03                                     ` Richard Stallman
2023-01-01  6:54                                       ` Eli Zaretskii
2023-01-01 19:14                                         ` Gregory Heytings
2023-01-01 20:11                                           ` Eli Zaretskii
2023-01-03  4:06                                         ` Richard Stallman
2023-01-03 12:06                                           ` Eli Zaretskii
2022-12-27 17:10                                 ` Eli Zaretskii
2022-12-27 17:31                                   ` Stefan Monnier
2022-12-27 18:08                                     ` Eli Zaretskii
2022-12-27 18:44                                       ` Stefan Monnier
2022-12-27 20:06                                         ` Philip Kaludercic
2022-12-27 21:13                                           ` Stefan Monnier
2022-12-28  2:52                                             ` Yuan Fu
2022-12-28 13:10                                               ` Gregory Heytings
2022-12-28 13:38                                               ` Lynn Winebarger
2022-12-28 14:41                                                 ` Danny Freeman
2022-12-29 11:14                                               ` Philip Kaludercic
2022-12-29 15:27                                                 ` Gregory Heytings
2022-12-29 15:40                                                   ` Lynn Winebarger
2022-12-29 21:50                                                     ` [SPAM UNSURE] " Stephen Leake
2022-12-29 22:37                                                       ` Lynn Winebarger
2022-12-30 14:10                                                       ` Lynn Winebarger
2022-12-30 16:25                                                         ` Targeting libtreesitter from wisent and other parser generators for emacs Lynn Winebarger
2022-12-31  8:25                                                           ` Eli Zaretskii
2022-12-31 13:07                                                             ` Lynn Winebarger
2022-12-29 15:45                                                   ` Tree-sitter introduction documentation Philip Kaludercic
2022-12-29 17:00                                                     ` Gregory Heytings
2022-12-29 17:12                                                       ` Philip Kaludercic
2022-12-29 17:31                                                         ` Gregory Heytings
2022-12-29 18:12                                                           ` Philip Kaludercic
2022-12-29 18:28                                                             ` Eli Zaretskii
2022-12-29 18:44                                                               ` Stefan Monnier
2022-12-29 19:34                                                                 ` Eli Zaretskii
2022-12-29 19:48                                                                   ` Stefan Monnier
2022-12-29 19:59                                                                     ` Eli Zaretskii
2022-12-29 18:32                                                             ` Stefan Monnier
2022-12-29 16:32                                                   ` Eli Zaretskii
2022-12-29 16:53                                                     ` Philip Kaludercic
2022-12-29 16:59                                                       ` Eli Zaretskii
2022-12-29 17:01                                                         ` Philip Kaludercic
2022-12-29 17:03                                                       ` Stefan Monnier
2022-12-29 17:12                                                         ` Gregory Heytings
2022-12-29 17:13                                                         ` Philip Kaludercic
2022-12-29 17:04                                                     ` Gregory Heytings
2022-12-30  1:01                                                 ` Gregory Heytings
2022-12-30 11:00                                                   ` Philip Kaludercic
2022-12-30 12:07                                                     ` Gregory Heytings
2022-12-30 13:10                                                       ` Philip Kaludercic
2022-12-30 15:23                                                         ` Gregory Heytings
2022-12-28 12:56                                         ` Gregory Heytings
2022-12-28 14:41                                           ` Stefan Monnier
2022-12-27 19:53                                       ` Dmitry Gutov
2023-01-01  3:03                                         ` Richard Stallman
2022-12-27 13:51                         ` tomas
2022-12-27 15:58                         ` Stefan Monnier
2022-12-16 17:23   ` Perry Smith
2022-12-16 17:31     ` Eli Zaretskii
2022-12-16 19:08       ` Perry Smith
2022-12-16 19:37         ` Eli Zaretskii
2022-12-16 20:05           ` Perry Smith
  -- strict thread matches above, loose matches on Subject: below --
2022-12-17  4:50 Payas Relekar
2022-12-18  6:32 Pedro Andres Aranda Gutierrez
2022-12-18  8:07 ` Eli Zaretskii
2022-12-18 10:39   ` Pedro Andres Aranda Gutierrez
2022-12-18 11:44     ` Eli Zaretskii
2022-12-31  6:59 Pedro Andres Aranda Gutierrez
2022-12-31  7:47 ` Eli Zaretskii

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=71cfe4e8-3bb8-b0a6-9be5-8c0a6d92cfab@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=theophilusx@gmail.com \
    /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).