From: Ergus <spacibba@aol.com>
To: Arthur Miller <arthur.miller@live.com>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>, emacs-devel@gnu.org
Subject: Re: [SPAM UNSURE] Maybe we're taking a wrong approach towards tree-sitter
Date: Fri, 30 Jul 2021 15:57:58 +0200 [thread overview]
Message-ID: <20210730135758.y7eol56zyszo5boe@Ergus> (raw)
In-Reply-To: <AM9PR09MB49779A1BFA2752EFBFEB6B4296EC9@AM9PR09MB4977.eurprd09.prod.outlook.com>
On Fri, Jul 30, 2021 at 03:30:42PM +0200, Arthur Miller wrote:
>�scar Fuentes <ofv@wanadoo.es> writes:
>
>> Arthur Miller <arthur.miller@live.com> writes:
>>
>>> I undestand that having specialized regex matcher is more efficient than
>>> some generalized regular matcher current font-locking in Emacs relies
>>> upon, but is it *that* more efficient to be worth the extra troubles?
>>
>> AFAIU this is not about efficience, but mainly about correctness (modern
>> languages are increasingly more difficult to analyze)
>
>Ok, I understand, and I can buy that one. Question is if it is still
>worth just for the syntax hightlight and indentation? If I get some
>spurious color here or there sometimes not colored, do I care?
>
Yes, we care. Syntax highlight for an editor is a basic feature in 2021.
>Can that syntax tree of TS be exposed to lisp and used for some other
>purposes,
This is the idea. use the tree for navigations like up-list or
goto-defun for example. Maybe not the tree directly, but the information
it provides (maybe calling TS function wrappers or setting the TS
information as text properties).
>or is it just internal to TS and only output we see is some
>colors on the screen?
>
How we use it is more a design choice. We can access the tree
information with the TS api or we can just put the tree's information as
text properties... imagination is the limit ;)
>> and also about
>> decreasing the maintenance load.
>Sure, but it is also a limitation. If Emacs will rely on TS maintainers
>to create new grammars and update existing ones when language changes,
>it means Emacs users will have to wait for changes until they are
>fixed upstream, similar as how gnu/linux distros work regarding
>packaging. Of course, a user who wish to modify or introduce new
>language can always rely on old font-lock or go through pain of TS
>toolilng based on JS and custom tools. Lisp frontend to that toolchain
>can probably be developed but that is even more work.
>
Sincerely; create a grammar for TS is much simpler than create a mode
with font-lock, navigation commands, indentation rules and some
flymake. All the modes with TS will be a bit more consistent in colors
and keybindings (now we have modes where all commands use different
prefixes, or lacking navigation or with different indentation
customs. So using them is like learning different editors for every
language)
>> In the process, Emacs gets support for
>> some new languages too.
>
>Yes, it is always nice I guess :). Is there really demand for some
>language currently provided in TS and not in Emacs?
>
Indeed. As I mentioned before web developers are using VScode or neovim
because Angular, React, Nodejs and Python are painfully supported
(compared to VScode or Sublime). Rust is very limited supported in
emacs, so users rely on external packages like rust-mode, elpy or
anaconda that introduce different bindings, collisions and require some
complex setups for the basics.
>I don't know, I am maybe overly sceptical to TS; I don't mean it is a
>bad package, and I am sure it has it's place in other editors, I am just
>not sure how it fits in Emacs where everything is easily configurable
>and extensible.
>
It is just a good trade-off configurable enough for 99% of the use
cases. Unless we expect all the users to be advanced lisp hackers to
customize their fontlocking, indentation and navigation functions for
every single prog-mode.
next prev parent reply other threads:[~2021-07-30 13:57 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-28 1:57 Maybe we're taking a wrong approach towards tree-sitter Andrei Kuznetsov
2021-07-28 3:53 ` [SPAM UNSURE] " Stephen Leake
2021-07-28 8:23 ` Manuel Giraud
2021-07-28 11:48 ` Andrei Kuznetsov
2021-07-28 13:04 ` Eli Zaretskii
2021-07-28 13:14 ` Andrei Kuznetsov
2021-07-28 13:27 ` Eli Zaretskii
2021-07-28 13:31 ` Andrei Kuznetsov
2021-07-28 14:24 ` Dmitry Gutov
2021-07-28 14:36 ` Dmitry Gutov
2021-07-28 14:51 ` Daniele Nicolodi
2021-07-28 16:10 ` Eli Zaretskii
2021-07-28 16:24 ` Perry E. Metzger
2021-07-28 16:29 ` Eli Zaretskii
2021-07-29 23:12 ` Stephen Leake
2021-07-29 23:21 ` Yuan Fu
2021-07-30 18:38 ` Stephen Leake
2021-07-30 0:41 ` Andrei Kuznetsov
2021-07-30 12:06 ` Arthur Miller
2021-07-30 12:52 ` Óscar Fuentes
2021-07-30 13:30 ` Arthur Miller
2021-07-30 13:57 ` Ergus [this message]
2021-07-30 14:52 ` Arthur Miller
2021-07-30 13:59 ` Eli Zaretskii
2021-07-30 15:45 ` Arthur Miller
2021-07-30 13:32 ` Ergus
2021-07-30 15:07 ` Arthur Miller
2021-08-02 22:13 ` Perry E. Metzger
2021-07-30 18:42 ` Stephen Leake
2021-07-30 6:05 ` Eli Zaretskii
2021-07-31 12:12 ` Stephen Leake
2021-07-31 13:07 ` Eli Zaretskii
2021-07-31 16:55 ` Stephen Leake
2021-07-31 17:12 ` Eli Zaretskii
2021-07-28 11:43 ` Andrei Kuznetsov
2021-07-28 11:50 ` Eli Zaretskii
2021-07-28 12:06 ` Andrei Kuznetsov
2021-07-28 13:05 ` Eli Zaretskii
2021-07-28 13:16 ` Andrei Kuznetsov
2021-07-28 12:36 ` Ergus
2021-07-28 13:07 ` Andrei Kuznetsov
2021-07-28 13:16 ` Eli Zaretskii
2021-07-28 13:27 ` Andrei Kuznetsov
2021-07-28 13:32 ` Eli Zaretskii
2021-07-28 13:38 ` Andrei Kuznetsov
2021-07-28 14:41 ` Manuel Giraud
2021-07-28 15:15 ` Perry E. Metzger
2021-07-28 16:10 ` Eli Zaretskii
2021-07-29 23:25 ` [SPAM UNSURE] " Stephen Leake
2021-07-30 0:54 ` Andrei Kuznetsov
2021-07-30 3:02 ` Andrei Kuznetsov
2021-07-30 18:48 ` Stephen Leake
2021-07-28 15:12 ` Perry E. Metzger
2021-07-29 23:28 ` Stephen Leake
2021-07-30 0:19 ` Perry E. Metzger
2021-07-30 18:44 ` [SPAM UNSURE] " Stephen Leake
2021-07-29 4:35 ` Richard Stallman
2021-07-28 15:09 ` Perry E. Metzger
2021-07-29 23:35 ` 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=20210730135758.y7eol56zyszo5boe@Ergus \
--to=spacibba@aol.com \
--cc=arthur.miller@live.com \
--cc=emacs-devel@gnu.org \
--cc=ofv@wanadoo.es \
/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).