From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ongaro Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Sat, 11 Mar 2023 04:45:21 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3944"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:IsdA2j0CvvwM8hUjc0owW9wLOJQ= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 11 20:23:45 2023 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 1pb4oi-0000pH-Q7 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Mar 2023 20:23:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pb4o2-0005si-74; Sat, 11 Mar 2023 14:23:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb4lD-0005X0-6s for emacs-devel@gnu.org; Sat, 11 Mar 2023 14:20:07 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pb4lA-0002DK-Nd for emacs-devel@gnu.org; Sat, 11 Mar 2023 14:20:06 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pb4l7-0006pV-Vs for emacs-devel@gnu.org; Sat, 11 Mar 2023 20:20:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 11 Mar 2023 14:22:59 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304338 Archived-At: I'm also "just" an Emacs user, but I suppose that should allow me to chime in? Pedro Andres Aranda Gutierrez writes: > On Thu, 16 Feb 2023 14:05:34 Yuan Fu 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.