From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs) Date: Thu, 2 Apr 2020 14:27:30 -0400 Message-ID: <9F3099CD-EAA4-4995-92B4-764A2E5815F3@gmail.com> References: <83tv22x9lx.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_07EA5227-BF36-4DD5-882F-B74F8E86D093" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="106720"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs-devel@gnu.org, Stefan Monnier , Dmitry Gutov , acm@muc.de, Eli Zaretskii , akrl@sdf.org To: =?utf-8?B?7KGw7ISx67mI?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 02 20:28:44 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 1jK4a3-000RdG-Mn for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 20:28:43 +0200 Original-Received: from localhost ([::1]:45902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK4a2-0004VV-JN for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Apr 2020 14:28:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55666) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jK4Yz-00031a-Jc for Emacs-devel@gnu.org; Thu, 02 Apr 2020 14:27:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jK4Yy-0005ju-C3 for Emacs-devel@gnu.org; Thu, 02 Apr 2020 14:27:37 -0400 Original-Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:47021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jK4Yv-0005cX-Ja; Thu, 02 Apr 2020 14:27:33 -0400 Original-Received: by mail-qv1-xf43.google.com with SMTP id bu9so2196613qvb.13; Thu, 02 Apr 2020 11:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yG9Ea4ou/D5DUS+hynm/74j1ohcNOYDmywFlX/kcB5A=; b=MtmEjXC3CeHElafOc8P9v4Zr3yVrCq2Z5Ccgfrs1cg13/38xyjyfUJ79af1t/SNg7o zZBAeVOOI8BfJ8S+CBC4VTn/3vlU+Mis1hwPKUnYVtL2hh6BLfYeqVg5v0NGiFohQkhc Qut+FRtqYSI1rJ4aaD0HzhyKzv/HR2deFZYuCBPCRvYLKNjO7PpgM2tj73qo+fNCweYa 6Y+5MA2ajOyySA2mfuWmH9aIP5mt1ioCe2lrXycUaNzNB5klQ9HO7ai/6vzovEvyKAvq Ca15fCqtJlP7yU0PavHu/UvGCM/dWpYcNdpFx449LGDVEeGvhncwOfHGKji3tw7ih8z0 Yhbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yG9Ea4ou/D5DUS+hynm/74j1ohcNOYDmywFlX/kcB5A=; b=RlV8AydQuOXdRc6wfHVGNtvX15FOufRsQlcVCPGK+aKleRi5XaKcNhww19XH08M8ck gxwiHQqrccHifpzP//N2hXRyOWS/Ya8iqOHJ4CjBBjxgozKF/5xtFqYB21KWQjKUXCO0 sFuNS5rWYD3+LNqpQTDIjVVgxcpAR4q/ZXEY8+DCGamR0Dia/0aLew1ZQpqiW1suUVfE sKQhYtIkj+pJzQX3fF3W8N1oyj0CwV+ApEC06mEe2GZfULVpMo8KITJmbJEb1O/NhFE/ rq9JxbD+vQ+wTU58VuLPZMgcL7Mu5nXVkCsTkdxSBksgPZqSZVFlCvOpHCEc0hk9rtOU HdHw== X-Gm-Message-State: AGi0PuaoWW7h7AwGz11RG5t5+R4nRUE2vNesH6bemXCKXXsHL3uPszvo GJklAeuJyKGYNtYgrv3n2zI= X-Google-Smtp-Source: APiQypLCqdit4+cYmlS4P00FcOBNAjcmGFi7m0ntSx+zRAN61ZfBrb7xQBpn2RAzN/Py5lQYypV2oQ== X-Received: by 2002:a0c:f701:: with SMTP id w1mr4723330qvn.126.1585852052598; Thu, 02 Apr 2020 11:27:32 -0700 (PDT) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id 69sm4042078qki.131.2020.04.02.11.27.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2020 11:27:31 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 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:246284 Archived-At: --Apple-Mail=_07EA5227-BF36-4DD5-882F-B74F8E86D093 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 2, 2020, at 2:03 PM, =EC=A1=B0=EC=84=B1=EB=B9=88 = wrote: >=20 > Maybe it=E2=80=99s just because I got lost through a lot of emails, = and Mail.app > doesn't really thread these emails properly, but I can=E2=80=99t = understand the > resistance of the front-up parsing. >=20 I think we are just discussing if there is any way to not parse the = whole buffer up front. (Which I consider unlikely because of the nature = of parsing.) > The current shipping CC-Mode is parsing most of the code front-up, and > clearly tree sitter will be faster than that. AFAIU parsing code only = by > only looking through a peephole is super hard except for some = languages > that are designed for peephole processing - and that makes it only = hard, > not super hard. Some modes doesn=E2=80=99t require a font-up parsing. IIRC, an example = from an earlier message is javascript-mode. Yuan= --Apple-Mail=_07EA5227-BF36-4DD5-882F-B74F8E86D093 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Apr 2, 2020, at 2:03 PM, =EC=A1=B0=EC=84=B1=EB=B9=88 = <pcr910303@icloud.com> wrote:

Maybe it=E2=80=99= s just because I got lost through a lot of emails, and = Mail.app
doesn't really thread these emails properly, but I can=E2=80=99= t understand the
resistance of the front-up parsing.


I think we are just discussing if there is any way = to not parse the whole buffer up front. (Which I consider unlikely = because of the nature of parsing.)

The current shipping CC-Mode is = parsing most of the code front-up, and
clearly tree = sitter will be faster than that. AFAIU parsing code only by
only looking through a peephole is super hard except for some = languages
that are designed for peephole processing - and that makes it = only hard,
not super hard.

Some modes doesn=E2=80=99t= require a font-up parsing. IIRC, an example from an earlier message is = javascript-mode.

Yuan
= --Apple-Mail=_07EA5227-BF36-4DD5-882F-B74F8E86D093--