From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: [SPAM UNSURE] Re: How to add pseudo vector types Date: Wed, 21 Jul 2021 09:54:45 -0700 Message-ID: <86k0lj4nfu.fsf@stephe-leake.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> <1AAB1BCC-362B-4249-B785-4E0530E15C60@gmail.com> <83czri67h0.fsf@gnu.org> <46BBFF88-76C3-4818-8805-5437409BEA93@gmail.com> <83wnpq46uk.fsf@gnu.org> <533BD53B-4E85-4E9E-B46A-346A5BBAD0F5@gmail.com> <258CB68D-1CC1-42C8-BDCD-2A8A8099B783@gmail.com> <1a776770-50b7-93cd-6591-c9a5b3a56eb8@gmail.com> <86a6mh54ko.fsf@stephe-leake.org> <680f895c-a787-0a05-d29e-f90525cbc376@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24130"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) Cc: Stefan Monnier , emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 21 18:56:57 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 1m6FWi-00060R-RC for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Jul 2021 18:56:57 +0200 Original-Received: from localhost ([::1]:57640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m6FWh-0003C5-T2 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Jul 2021 12:56:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6FUl-00004z-FT for emacs-devel@gnu.org; Wed, 21 Jul 2021 12:54:55 -0400 Original-Received: from gateway31.websitewelcome.com ([192.185.144.94]:46929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6FUj-0005jS-K9 for emacs-devel@gnu.org; Wed, 21 Jul 2021 12:54:55 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id BC22915734E for ; Wed, 21 Jul 2021 11:54:50 -0500 (CDT) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with SMTP id 6FUgmgbxZ7sOi6FUgmSY8B; Wed, 21 Jul 2021 11:54:50 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ryn/VE6bYcXPFhGcQWT/YWGcT3v299BUm77z8zm9wms=; b=nZ8JJIii4Ou01PJnsCbrXBx9om uPg5vegTxpNprg6MsWJ6ZZtVRxV4Dudiw6sUfOylPM8NAHrn9aakE4DgYBtD9F5QzotFjA9SEAKa9 HIquYLksGJgqL5UoZFQdfC5PWTeE/ovcpW3Xahzkrf0jz4+cg0kPg7UbUsKYvlOK/RAEX4sh4NqDH n3ka7r7YiAFo6nfRPuNOl9Jp0zq5RGj3FW4K8rynrgG+9lwQFN1YuokRJOXdFi2pU+OSLLKh88kzT HgDG6+4PExKRUmFV1n/4C8dvgKJPEo1S6ULxRO4Tpas3uN0JVpJFP26HoSGW7KsXdOsnua1hAYzTb NlYK6JFQ==; Original-Received: from [76.77.182.20] (port=61989 helo=Takver4) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m6FUf-000n35-Ou; Wed, 21 Jul 2021 10:54:49 -0600 In-Reply-To: <680f895c-a787-0a05-d29e-f90525cbc376@gmail.com> (=?utf-8?Q?=22Cl=C3=A9ment?= Pit-Claudel"'s message of "Tue, 20 Jul 2021 14:04:25 -0400") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1m6FUf-000n35-Ou X-Source-Sender: (Takver4) [76.77.182.20]:61989 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 9 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.144.94; envelope-from=stephen_leake@stephe-leake.org; helo=gateway31.websitewelcome.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action 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:271421 Archived-At: Cl=C3=A9ment Pit-Claudel writes: > On 7/20/21 12:32 PM, Stephen Leake wrote: >> Computing fontification and indentation must be synchronous. > > Must? What makes you say that? Otherwise the results cannot be applied to the buffer, in general. >> Except that the results will not be useful, since they won't apply to >> the original buffer if it is changed. > > Then you will send the additional changes and wait. It is that "wait" that makes it synchronous. Note that synchronous is not the same as single-thread; mulitple threads can be used, as long as the main thread waits for the parse results. But synchronous is also not the same as requiring the buffer text to be read-only while the parser is running, which is an additional requirement if the parser is reading the buffer text directly. > TS is an incremental parser, so the work it will have done > incorporating part of the changes will not be wasted. Not guarranteed if the new changes are before some of the old ones, and TS has no support for interrupting a parse to add more changes. > Concrete example: if you have a bit of elisp that runs for .5s to make > modifications to the buffer, then press "indent", and only then do you > send changes to TS and wait for the response synchronously, then you > will wait for .5s + time to incorporate all changes. If you start > processing the changes in parallel as they are made by the Elisp code, > then you will only wait for .5s + time to incorporate only the changes > that had not been processed yet. It might be possible to implement the incremental parse algorithm so it can accept changes after the parse starts. One requirement would be that the new changes must be after the current parse point, which is a race condition. In your example, "indent" will go back to the first edit point to compute the indent there; that is pretty much guarranteed to be before the current parse point, which will be on one of the later changes. Neither TS nor wisi support that; both have a separate Edit_Tree step that applies all the changes to the parse tree before Parse is called. It might be possible to integrate Edit_Tree into Parse, so that changes are only applied when they are actually needed. But Edit_Tree and Parse are already very complicated; keeping them separate is a good thing for correctness and debugging. Hmm. Perhaps you are not talking about interrupting the parse; you are assuming that the parse for each change completes before the next change arrives. Depending on the details of the changes, that might or might not be wasted time; if we are on battery power (or worried about carbon footprint), this might be a bad idea. It still means fontification has to wait for the parse to complete on all of the changes; it's synchronous in the sense that no user actions on the buffer are allowed between the time fontification is requested and the time text properties are applied. --=20 -- Stephe