From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to add pseudo vector types Date: Wed, 21 Jul 2021 22:37:25 +0300 Message-ID: <83lf5z4fwq.fsf@gnu.org> References: <83h7gw6pyj.fsf@gnu.org> <45EBF16A-C953-42C7-97D1-3A2BFEF7DD01@gmail.com> <83y2a764oy.fsf@gnu.org> <83v95b60fn.fsf@gnu.org> <00DD5BFE-D14E-449A-9319-E7B725DEBFB3@gmail.com> <83r1fz5xr9.fsf@gnu.org> <86mtqh54wo.fsf@stephe-leake.org> <83czrd53z2.fsf@gnu.org> <86wnpj4qh0.fsf@stephe-leake.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30156"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 21 21:39:14 2021 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 1m6I3m-0007eP-6j for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Jul 2021 21:39:14 +0200 Original-Received: from localhost ([::1]:51124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6I3k-0000cQ-5D for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Jul 2021 15:39:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6I2B-0007AQ-Bb for emacs-devel@gnu.org; Wed, 21 Jul 2021 15:37:35 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60428) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6I2A-0007H5-ES; Wed, 21 Jul 2021 15:37:34 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1351 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6I2A-0001wY-1K; Wed, 21 Jul 2021 15:37:34 -0400 In-Reply-To: <86wnpj4qh0.fsf@stephe-leake.org> (message from Stephen Leake on Wed, 21 Jul 2021 08:49:15 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:271431 Archived-At: > From: Stephen Leake > Cc: casouri@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Wed, 21 Jul 2021 08:49:15 -0700 > > > I fail to see the significance of the difference. Surely, you could > > hand it a block of text with changes to mean that this block replaces > > the previous version of that block. It might take the parser more > > work to update the parse tree in this case, but if it's fast enough, > > that won't be the problem. Right? > > tree-sitter doesn't store the previous text, so there's nothing to > compare it to. There was nothing about comparison in my text. You tell TS that editing replaced a block of text between A and B with block between A and C, without revealing the fine-grained changes inside that block. This must work, because editing could indeed do just that. > Alternately, this would require the parser to store the > previous text so it can compute the diff; that could be added in a > wrapper around tree-sitter. Presumably, TS has already solved this problem, because it needs that for allowing the clients to communicate the changes to it. > > That's why I'm trying to find a simpler, less wasteful strategies. > > Since TS is very fast, we can trade some of the speed for simpler, > > more scalable design of tracking changes. > > I don't see how optimizing the change list makes it more "scalable"; Keeping too much information about each buffer is less scalable, especially with many large buffers. > In practice font-lock is triggered on every character typed by the user > (Emacs is faster than people can type), so there will typically be only > one change; nothing to optimize. Editing doesn't include just typing one character at a time. There's killing, yanking, C-x i, M-/, M-\, C-M-\, smart completion, etc.