emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make all tree-sitter modes optional


From: Ongaro
Subject: Re: Make all tree-sitter modes optional
Date: Sat, 11 Mar 2023 04:45:21 -0800
User-agent: Gnus/5.13 (Gnus v5.13)

I'm also "just" an Emacs user, but I suppose that should allow me to
chime in?

Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:

> On Thu, 16 Feb 2023 14:05:34 Yuan Fu <casouri@gmail.com> wrote:
>
>>+1. It’ll be a long way until c-ts-mode can be comparable to c-mode.
>
>>Yuan
>
> +1 here too. With some additional comments. If memory serves, Eli
> asked for "user" feedback. Here you are ;-)

Yes, but my impression was that he wanted to have feedback on the
behavior of automatically updated auto-mode-alist entries in particular.

> Now, have I tried tree-sitter? Yes... I got it running on Linux. But
> the fuzz was not worth the gain. I saw from second one what
> yansippets, tramp, eglot (you name it) was offering and I decided to
> go for it (BTW, I'm so happy that eglot is is part of Emacs now). I
> don't see it in tree-sitter.

I think nobody is expecting a big gain at this moment (although I could
notice the much more granular font-locks in Python mode right way). But
I think the significance of the inclusion of tree-sitter is far greater
than all of the packages you mention. Just take this quote from James
Gosling in 2008:

> Ahhh, Emacs. It was a really good idea in like 1978. That’s what? 30
> years ago? Get over it guys. 30 years ago, that’s like 15 cranks of
> Moore’s Law at least, certainly you can do something with two to the
> fifteenth in CPU power. I certainly think you should give Netbeans a
> try. Having a real live semantic platform underneath you analysing
> every keystroke can do some pretty magical things. So, just get over
> it. You’re not using a Teletype anymore….it’s just dumb. Just stop.

And here he is pointing the finger right into the wound. Emacs needs the
ability for a proper real time lexical and semantic analysis. Doing
everything via regular expressions doesn't cut it. One can't parse non
regular languages via regular expressions almost by definition! If this
isn't addressed Emacs is doomed for obsolescence at least as a
programming platform. Sure, we still may continue to use it for decades
to come, but I don't think the goal of the Emacs community is just to
support a shrinking aging userbase?

And that is where tree-sitter is getting me really exited, since it's
opening the possibilities for proper real time analysis. If we get this
Emacs can get a serious contender for VS-Code and alike. Sure, once one
experiences the power of a package like tramp, one is sold. But if you
ask the average VS-Coder I bet they don't care. The fundamentals must be
right first and for programming that is a proper code parser.

I myself must admit that I resorted to Eclipse/IntelliJ when I had to do
Java for a few years. That may be one of the reasons I like saner
languages like Clojure better. But still, Emacs should strive to provide
an equally good experience for these other languages.

Another aspect which is getting me excited is my expectation that
tree-sitter should help to lift a lot of the maintenance burden for the
support of old and new language modes. This in turn should free up time
to improve other aspects of Emacs (some of which you probably care about
more). E.g. did you read Steve Yegge's story about the implementation of
js-mode? It's quite a journey (see
http://steve-yegge.blogspot.com/2008/03/js2-mode-new-javascript-mode-for-emacs.html).
In the end he had to make some compromises (e.g. allow the user to
switch indentations by pressing tab multiple times). It's still a great
mode but I'm sure the story would have been much different if
tree-sitter would have been available at the time. And something like
this happens to probably every mode author.

Sure, old established and battle tested modes like c-mode will probably
continue to be maintained for like forever, but now there is a much
easier way to integrate new languages or newer language versions. And
the time saved can be spend to bring Emacs forward in other ways.

> so, I know this is not exactly FOSS compliant, but it is part of the
> experience that may shy away users outside FOSS operating systems:
>
> In non-free operating systems, it is getting more difficult to get
> compiled third-party libraries downloaded and running. So, I don't
> anticipate it will easy with the tree-sitter DLLs or DYLIBs if you get
> them from the outside world. This means that you will need to compile
> them on your system to work with them. And that will be yet another
> argument for sys-admins to ban Emacs from the "professional"
> programming environment. And I think that's really sad...

I don't understand this argument. If you're an Emacs user who uses
tree-sitter the probability is high that you're also a developer so you
need development tools like a compiler anyway. Especially in a
"professional" programming environment. A sys-admin banning that would
be an admin banning you from work.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]