unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Daniel Colascione <dancol@dancol.org>
Cc: "Emacs-devel@gnu.org" <Emacs-devel@gnu.org>
Subject: Re: Tree-sitter maturity
Date: Tue, 31 Dec 2024 16:47:33 +0000	[thread overview]
Message-ID: <87y0zviyu2.fsf@posteo.net> (raw)
In-Reply-To: <E2C32D27-EEC2-4DD2-B6F6-8827820B880E@dancol.org> (Daniel Colascione's message of "Tue, 31 Dec 2024 08:57:18 -0500")

[Re-adding Emacs-Devel]

Daniel Colascione <dancol@dancol.org> writes:

> On December 31, 2024 8:00:17 AM EST, Philip Kaludercic <philipk@posteo.net> wrote:
>>Daniel Colascione <dancol@dancol.org> writes:
>>
>>[...]
>>
>>>>> There is also the general point of helping to realise software freedom,
>>>>> where a -ts-mode makes it much more difficult (though of course not
>>>>> impossible) to adjust a grammar.  Wasn't there some complication when
>>>>> trying to reload a grammar?  The additional dependencies and the
>>>>> indirect effect of changes compared with Elisp is something we should be
>>>>> concerned about when trying to maintain "the spirit of Emacs" (which of
>>>>> course means different things to different people).
>>>>>
>>>>> Vendoring might help to reproduce builds if that turns out to be a big
>>>>> issue, but I am not a fan of the additional hurdles in making use of the
>>>>> source code.  Does anyone know of alternative, less invested
>>>>> build-chain the re-uses the libtree-sitter.so library.
>>>>
>>>>Oh, and another point I have been reminded of while writing this: The
>>>>recent addition of more and more -ts-modes without "regular" -modes has
>>>>been slightly concerning.  While I understand that re-implementing a
>>>>"lua-mode" or "php-mode" from scratch is not an effort one wants to
>>>>impose on anymore, simpler files such as dockerfile-mode or go-mod-mode
>>>>/without/ Tree Sitter would be a nice thing to have for people on
>>>>systems without Tree Sitter, or without the ability to download and
>>>>build code from GitHub (e.g. missing internet access, without Git/GCC,
>>>>without the necessary development libraries).  Even if the experience
>>>>were degraded, just re-using the keywords to provide some basic
>>>>highlighting would be a nice fallback.
>>>
>>> I think it's inevitable that, long term, tree sitter becomes a
>>> mandatory dependency and we delete the bespoke Emacs modes. It just
>>> doesn't make sense to replicate per-language work the community is
>>> already doing. There's no economic or software freedom benefit in
>>> doing so. 
>>
>>As long as (live-)modifying a Tree Sitter grammar is significantly more
>>difficult than with the regular major modes, I think that -ts-modes have
>>a significant advantage -- especially for Emacs.
>
> You meant non-ts? 

No, I meant that modifying the grammar of a -ts-mode is more difficult,
as changes to the JS files requires a special toolchain and IIUC cannot
be reloaded inside of Emacs.  Or am I wrong?

>                   Anyway, I've already described ways to make modify
> TS easy. (For example, not introducing unnecessary complexity to the
> distribution process.) It'd be better to make TS customization easy
> than redundantly write and maintain TS and non-TS modes under the
> theory that the latter can be more easily customized.

I haven't been able to follow the mailing list for the past few days, I
would appreciate i you could give me the message ID where you elaborated
on this.

>>>           If we try, we'll just confuse users and ship modes that fall
>>> further and further behind those of other systems.
>>
>>Ideally, it should have been possible to hide the difference between
>>tree sitter and non-tree sitter modes.  From what I understand that was
>>not possible with the existing framework.  After all, most of the time
>>if tree sitter works, you don't notice it directly.  I *do* notice it if
>>something doesn't work as expected (e.g. `mark-sexp' not selecting the
>>right regions is something that has been a deal breaker for me).
>
> That's not my ideal.

To clarify, I meant that ideally the user shouldn't notice Tree Sitter,
not the implementer.  If everything works, it just improves indentation,
structural navigation, syntax highlighting, etc.  These are the effects
of tree sitter, not tree sitter itself.  This is different from other
editor-generic systems like LSP, as Eglot exposes some functionality
that people use directly, such as eglot-rename or eglot-code-actions.

> Making modes work with or without tree sitter would involve doing a
> lot of hairy language specific work twice, once to work with TS and
> once without. This duplication of effort just doesn't make any sense
> to me. How is anyone better off for having done this redundant work
> instead of something else?

Most of the time, the non-TS modes already exist and have accumulated a
lot of functionality over time: REPL support, integration with Flymake,
Eldoc, CAPF, custom user options, etc.  What irks me about some of the
new -ts-modes is that they provide a significant degradation in these
aspects for now.  We have to replicate all of this for -ts-modes.

> Even if we could: why confuse users with a choice they're not prepared
> to make? Why distract them with the difference between TS and non-TS
> (which I'll start calling "legacy modes", come to think of it)? Simple
> is better, especially for users.

I agree that it would be better if we could hide the distinction.  But
tree sitter modes are not in a position to replace the traditional modes
right now.  Especially if using them at all requires fetching source
code from GitHub.

One thing one can do remedy the concrete problem that we have -ts-modes
without corresponding non-ts-modes is to fall back onto
`define-generic-mode' and at least provide some basic syntax
highlighting for keywords -- which all -ts-modes have to declare anyway.
That way languages like dockerfile(-ts)-mode or go-mod(-ts)-mode would
at least do something, given that the information is already there.



  parent reply	other threads:[~2024-12-31 16:47 UTC|newest]

Thread overview: 195+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20 15:13 My resignation from Emacs development Alan Mackenzie
2024-11-20 15:34 ` Eli Zaretskii
2024-11-20 16:23 ` Christopher Dimech
2024-11-21  6:22   ` Gerd Möllmann
2024-11-21 10:05     ` Christopher Dimech
2024-11-21 11:23       ` Gerd Möllmann
2024-11-21 11:40         ` Eli Zaretskii
2024-11-21 10:29   ` Alan Mackenzie
2024-11-21 12:26     ` Christopher Dimech
2024-11-20 16:42 ` Alfred M. Szmidt
2024-11-20 17:04 ` tomas
2024-11-20 21:56 ` Dmitry Gutov
2024-11-21  2:28 ` Stefan Kangas
2024-11-21 12:34   ` Tree-sitter maturity (was: My resignation from Emacs development) Peter Oliver
2024-11-23 13:41     ` Stefan Kangas
2024-11-24  2:10     ` Tree-sitter maturity Björn Bidar
     [not found]     ` <67428b3d.c80a0220.2f3036.adbdSMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-17 22:11       ` Yuan Fu
2024-12-18 13:34         ` Eli Zaretskii
2024-12-19  1:40           ` Yuan Fu
2024-12-19  8:17             ` Eli Zaretskii
2024-12-20  9:13             ` Björn Bidar
     [not found]             ` <6765355b.c80a0220.1a6b24.3117SMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-20  9:29               ` Yuan Fu
2024-12-23  0:43                 ` Björn Bidar
     [not found]                 ` <6768b256.c80a0220.222b1b.64e6SMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-24  1:20                   ` Yuan Fu
     [not found]                 ` <87frmfxm8y.fsf@>
2024-12-24  4:52                   ` Richard Stallman
2024-12-24 12:32                     ` Eli Zaretskii
2024-12-24 21:31                       ` Xiyue Deng
2024-12-26  4:30                         ` Richard Stallman
2024-12-27 10:54                           ` Philip Kaludercic
2024-12-27 12:40                             ` Eli Zaretskii
2024-12-27 13:46                               ` Daniel Colascione
2024-12-27 14:19                                 ` Philip Kaludercic
2024-12-27 14:24                                   ` Daniel Colascione
2024-12-27 14:57                                     ` Philip Kaludercic
2024-12-27 15:02                                       ` Philip Kaludercic
2024-12-29  4:19                                         ` Richard Stallman
2024-12-29  4:23                                           ` Daniel Colascione
2024-12-29  7:44                                             ` Eli Zaretskii
2024-12-29  8:01                                               ` Daniel Colascione
2024-12-29  8:41                                                 ` Eli Zaretskii
2024-12-29  8:59                                                   ` Yuan Fu
2024-12-29  9:14                                                     ` Daniel Colascione
2024-12-29  9:24                                                       ` Eli Zaretskii
2024-12-29 10:01                                                         ` Daniel Colascione
2024-12-29 13:35                                                           ` Eli Zaretskii
2024-12-29 20:12                                                             ` Daniel Colascione
2024-12-29 10:13                                                       ` tomas
2024-12-29 10:21                                                       ` Yuan Fu
2024-12-29 14:59                                                         ` Daniel Colascione
2024-12-29 14:14                                                       ` Dmitry Gutov
2024-12-29  7:26                                           ` Eli Zaretskii
     [not found]                                         ` <904957B9-55C1-42DF-BE6A-16986A4B539A@dancol.org>
     [not found]                                           ` <87r05o2eji.fsf@posteo.net>
     [not found]                                             ` <E2C32D27-EEC2-4DD2-B6F6-8827820B880E@dancol.org>
2024-12-31 16:47                                               ` Philip Kaludercic [this message]
2024-12-29 14:36                                     ` Lynn Winebarger
2024-12-29 20:36                                       ` Daniel Colascione
2024-12-29 23:29                                         ` Björn Bidar
     [not found]                                         ` <6771db94.050a0220.386e00.e451SMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-30  0:30                                           ` Yuan Fu
2024-12-30  0:36                                             ` Daniel Colascione
2024-12-30  1:00                                               ` Yuan Fu
2024-12-31  9:48                                               ` Philip Kaludercic
2024-12-30  3:20                                             ` Lynn Winebarger
2024-12-31  3:22                                             ` Björn Bidar
2024-12-31 22:29                                         ` Lynn Winebarger
2025-01-01 20:23                                           ` Björn Bidar
2024-12-28 12:20                                   ` Peter Oliver
2024-12-28 12:23                                     ` Philip Kaludercic
2024-12-29 14:50                                     ` Björn Bidar
2024-12-27 14:59                                 ` Eli Zaretskii
2024-12-27 15:05                                   ` Daniel Colascione
2024-12-27 15:31                                     ` Eli Zaretskii
2024-12-27 15:37                                       ` Daniel Colascione
2024-12-28  1:08                                       ` Stefan Kangas
2024-12-29  4:19                                         ` Richard Stallman
2024-12-29  4:21                                           ` Daniel Colascione
2024-12-29  6:41                                             ` tomas
2024-12-29  6:43                                               ` Daniel Colascione
2024-12-29  6:54                                                 ` tomas
2024-12-29  7:05                                                   ` Daniel Colascione
2024-12-29  8:56                                                     ` tomas
2024-12-29 15:16                                                   ` Björn Bidar
2024-12-29 15:05                                     ` Björn Bidar
     [not found]                                     ` <87ed1qedhl.fsf@>
2024-12-29 15:21                                       ` Daniel Colascione
2024-12-29 16:02                                         ` Björn Bidar
     [not found]                                         ` <663726A2-141B-4B98-80FB-BD93E99AC122@dancol.org>
2024-12-29 19:06                                           ` Björn Bidar
     [not found]                                           ` <6771d84b.050a0220.250914.d0e0SMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-30  0:56                                             ` Yuan Fu
2024-12-27 14:11                               ` Philip Kaludercic
2024-12-27 15:06                                 ` Eli Zaretskii
2024-12-31 13:47                                   ` Philip Kaludercic
2024-12-27 18:29                               ` Ihor Radchenko
2024-12-28  7:55                                 ` Eli Zaretskii
2024-12-28  8:11                                   ` Ihor Radchenko
2024-12-28  8:58                                     ` Eli Zaretskii
2024-12-29 15:09                           ` Björn Bidar
2024-12-26  4:32                       ` Richard Stallman
2024-12-26  7:12                         ` Eli Zaretskii
2024-12-29 14:35                         ` Björn Bidar
2024-12-19 12:23           ` Peter Oliver
2024-12-19 12:42             ` Eli Zaretskii
2024-12-19 13:15             ` Vincenzo Pupillo
2024-12-20  8:59           ` Björn Bidar
2024-11-21 13:01   ` My resignation from Emacs development Alan Mackenzie
2024-11-21 13:48     ` Eli Zaretskii
2024-11-21 14:29       ` Alfred M. Szmidt
2024-11-22  0:01         ` Po Lu
2024-11-22  7:03           ` Eli Zaretskii
2024-11-22  8:14             ` Robert Pluim
2024-11-22  8:32               ` Eli Zaretskii
2024-11-22 23:59               ` Po Lu
2024-11-23  6:39                 ` Eli Zaretskii
2024-11-21 16:29       ` Alan Mackenzie
2024-11-22  5:35     ` Adam Porter
2024-11-22  7:24       ` Madhu
2024-11-22  8:11         ` Eli Zaretskii
2024-11-22  9:26           ` Madhu
2024-11-22 12:07             ` Eli Zaretskii
2024-11-22 12:40           ` Stefan Kangas
2024-11-22 13:06           ` Alan Mackenzie
2024-11-22 13:39             ` Stefan Kangas
2024-11-22 14:25             ` Eli Zaretskii
2024-11-25  4:28             ` Richard Stallman
2024-11-26 17:37               ` Alan Mackenzie
2024-12-13  4:35                 ` Richard Stallman
2024-12-15 15:27                   ` Alan Mackenzie
2024-12-15 15:48                     ` Eli Zaretskii
2024-12-15 20:43                       ` Alan Mackenzie
2024-12-19  4:22                     ` Richard Stallman
2024-12-19  8:26                       ` Eli Zaretskii
2024-11-23 22:18           ` Andrea Corallo
2024-11-22 10:57       ` Alan Mackenzie
2024-11-22 23:19         ` Adam Porter
2024-11-26 19:01       ` Daniel Radetsky
2024-11-26 19:51         ` Christopher Dimech
2024-11-27  2:18           ` Adam Porter
2024-11-27  9:36             ` Daniel Radetsky
2024-11-27  9:59             ` Christopher Dimech
2024-11-30  3:52             ` Richard Stallman
2024-11-30  7:53               ` Eli Zaretskii
2024-11-30 16:22                 ` Discuss new features/enhancements or large changes for users in emacs-devel [was: My resignation from Emacs development] Drew Adams
2024-11-30 16:56                   ` Eli Zaretskii
2024-11-30 21:06                     ` [External] : " Drew Adams
2024-12-01  6:00                       ` Eli Zaretskii
2024-12-03  7:26                 ` My resignation from Emacs development Richard Stallman
2024-12-03 13:33                   ` Eli Zaretskii
2024-11-30 16:21               ` Discuss new features/enhancements or large changes for users in emacs-devel [was My resignation from Emacs development] Drew Adams
2024-11-30 17:05                 ` Eli Zaretskii
2024-11-30 21:09                   ` [External] : " Drew Adams
2024-12-01  6:12                     ` Eli Zaretskii
2024-12-01 19:23                       ` Drew Adams
2024-12-03  7:25                   ` Richard Stallman
2024-12-03 13:32                     ` Eli Zaretskii
2024-12-06  4:48                       ` Richard Stallman
2024-12-02  4:09                 ` Richard Stallman
2024-12-02 13:04                   ` Discuss new features/enhancements or large changes for users in emacs-devel Eli Zaretskii
2024-12-02 15:32                     ` [External] : " Drew Adams
2024-12-05  5:08                     ` Richard Stallman
2024-12-05  6:33                       ` Eli Zaretskii
2024-12-02 15:29                   ` [External] : Re: Discuss new features/enhancements or large changes for users in emacs-devel [was My resignation from Emacs development] Drew Adams
2024-11-27  2:06         ` My resignation from Emacs development Adam Porter
2024-11-27  9:17           ` Daniel Radetsky
2024-11-22 15:36     ` Stefan Kangas
2024-11-22 17:48       ` Alan Mackenzie
2024-11-23 23:43     ` Stefan Monnier via Emacs development discussions.
2024-11-23  6:10   ` Richard Stallman
2024-11-23  7:48     ` Eli Zaretskii
2024-11-23 11:06       ` Christopher Dimech
2024-11-23 11:54         ` Eli Zaretskii
2024-11-23 12:48           ` Christopher Dimech
2024-11-23 23:59       ` Adam Porter
2024-12-01  3:50         ` Sean Whitton
2024-12-01  6:19           ` tomas
2024-11-24 18:12     ` Suhail Singh
2024-11-26  4:56       ` Richard Stallman
2024-11-26  7:38         ` Suhail Singh
2024-11-21  5:59 ` Gerd Möllmann
2024-11-22 11:36   ` Alan Mackenzie
2024-11-22 11:52     ` Eli Zaretskii
2024-11-23 10:36       ` Alan Mackenzie
2024-11-23 11:31         ` Eli Zaretskii
2024-11-21 13:39 ` Andrea Corallo
2024-11-21 19:01   ` Alfred M. Szmidt
2024-11-21 19:19     ` Christopher Dimech
2024-11-21 19:47     ` Eli Zaretskii
2024-11-21 19:40 ` Jim Porter
2024-11-24  4:35   ` Richard Stallman
2024-11-21 23:57 ` Po Lu
2024-11-22 17:26 ` On committing significant and/or controversial changes (was: My resignation from Emacs development) Ihor Radchenko
2024-11-22 17:47   ` Ship Mints
2024-11-22 19:04     ` Eli Zaretskii
2024-11-24  2:35       ` On committing significant and/or controversial changes Björn Bidar
2024-11-24  4:41         ` Adam Porter
2024-11-30  2:16           ` Björn Bidar
     [not found]       ` <87ttbx73zu.fsf@>
2024-11-24  8:26         ` Eli Zaretskii
2024-11-22 19:01   ` Eli Zaretskii
2024-11-23  6:10 ` My resignation from Emacs development Richard Stallman
2024-11-23  8:50   ` Eli Zaretskii
2024-11-23  6:10 ` Richard Stallman

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=87y0zviyu2.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=Emacs-devel@gnu.org \
    --cc=dancol@dancol.org \
    /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).