From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Thu, 02 Apr 2020 18:06:37 +0300 Message-ID: <83lfnex6yq.fsf@gnu.org> References: <83369o1khx.fsf@gnu.org> <83imijz68s.fsf@gnu.org> <831rp7ypam.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="85929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ubolonton@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 17:07:36 2020 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 1jK1RO-000ME9-RM for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 17:07:34 +0200 Original-Received: from localhost ([::1]:42824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK1RN-0007UB-TG for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 11:07:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45962) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK1Qm-0006cx-Ms for emacs-devel@gnu.org; Thu, 02 Apr 2020 11:06:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jK1Qm-0001XF-Bh; Thu, 02 Apr 2020 11:06:56 -0400 Original-Received: from [176.228.60.248] (port=4695 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jK1Ql-0006Mu-8L; Thu, 02 Apr 2020 11:06:56 -0400 In-Reply-To: (message from Stefan Monnier on Thu, 02 Apr 2020 09:02:41 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:246264 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , emacs-devel@gnu.org > Date: Thu, 02 Apr 2020 09:02:41 -0400 > > > If we really want to tackle this issue, there are other approaches to > > consider, e.g. background parsing, or parsing up until a time limit, and > > resume parsing when Emacs is idle. Tree-sitter's API supports the > > latter. > > Emacs is in dire need to exploit multiple cores. True. > It would be very natural to run tree-parser's initial parse > asynchronously in a separate thread. This requires to pass > tree-parser a *copy* of the buffer's text. This also raises a lot of issues and problems of its own, of which copying the buffer is the least one. We don't yet have any example of such asynchronous processing, so this feature will have to be the first that does it, and will then have to resolve the issues in addition to doing its main job.