From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: HaiJun Zhang Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sat, 4 Jan 2020 11:59:05 +0800 Message-ID: References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="5e100d8e_3b1dd403_4379" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149332"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org, Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 04 05:00:02 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1inabY-000chP-W2 for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 05:00:01 +0100 Original-Received: from localhost ([::1]:59222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inabX-0001qZ-TL for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 22:59:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41117) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inaaw-0001IS-VY for emacs-devel@gnu.org; Fri, 03 Jan 2020 22:59:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inaav-0005ln-4J for emacs-devel@gnu.org; Fri, 03 Jan 2020 22:59:22 -0500 Original-Received: from mail-oln040092253098.outbound.protection.outlook.com ([40.92.253.98]:6165 helo=APC01-SG2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inaat-0005Q5-Ta; Fri, 03 Jan 2020 22:59:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W0seJqzz6zX39kXhQpjX938ivJlQHDluEfNGK+/bDrWVdhcyyPUOz5nv9jCwoY9DAyMgK9GyIc6jD5y0+Sjio7cMTZ/p69Aw3iYHJQdK390VebziwyQN6M+9sXSB27YwFWez+ohu0wxh+/qD7TUQY5av7xGLaqLyeZmu+SQ3PzhGoFg9vs9h8DQ8MUk9l1DjCt3JrqCuj0m+SfbFhYnJFLuHsGiKTwdImq7JUBrt4xk8PnpigWfP4p4Hyu7YbAFPKsb/gilDDH8lCEbjjSqCW6PE0+43tzfI135TlBPPYMnIkNNX/+UKOG3bsbxxkfu1vBL3vmfsL2M4UJ+NC8GDmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OchaDQVdX/CW2ITkKlCz3klPvNX+0QpBBUcTzLqaeLI=; b=OUB5D20U8r7kia0gUOVVKqSoOgvmFPazy+cJZQMi+KXin/KJFHMSfoxc06t8RsUEueov3cGCWpESgfsI7CiBXdgPobsEFx8tyve3KkkrRjOo6o+aJRsjnpYjmb7/jvpiQUyxDWbNagTqoHaAEo9GGrupXqpW82YmAghnTwsclh99j+gIIqhQ9hFEcbR5v4yQ9IyYDVIqUwttAbEIav5MWyC1FxljOxCpG0dNlEiUpxwynk0LMLSh5sEZHnh3gdjfh7ZOgy9ysdZejLZSy+cOW+GJHbL510DPfzaxlxhsSgfHAbGdr8RyBYj403HI3dY1hWHDQEdYWtesRKRJ/78trw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OchaDQVdX/CW2ITkKlCz3klPvNX+0QpBBUcTzLqaeLI=; b=M6Zry7uH1wWT3CBFKwI+Og/bojd6B2zXsFr6o4XO6Adv6n43K1Zgd3hVo+awcTV0vHHEvyK+iCXT1lot3/iuZosMh2Fuz+R+NApx5K7LjTIOxJ3PcDt/iqJGU0pxo7E7RB2lcVjoxnOotX5x//3Ynm2P1w9nUbC68O0+ua9xGqRemyTigt9vXYHTcDioBw2ZdAQPHzzOZDz3S53fFX+yu/oKnjir1OAj0f0zfZ/OcrdDx6zy36+u3JWgMjSlCSis4MJ8bcIwzGiX2Z3EZ5fk5WxrV/L62GZDx6OB2h4oxgDVXX9s19ERkEnCOOKuJmocR/OFV0BDVkJEvBEc46lQ4Q== Original-Received: from SG2APC01FT015.eop-APC01.prod.protection.outlook.com (10.152.250.55) by SG2APC01HT045.eop-APC01.prod.protection.outlook.com (10.152.251.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Sat, 4 Jan 2020 03:59:14 +0000 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.250.59) by SG2APC01FT015.mail.protection.outlook.com (10.152.250.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Sat, 4 Jan 2020 03:59:14 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:35ED0BCEC7B3FD7AFB90F4657D2E27787D2B631FC2EB29756C098B179098CB9A; UpperCasedChecksum:5B3E815021D498856AC9BBBC9F5F843296448EF8472FDD9056955DD5507E8968; SizeAsReceived:8628; Count:47 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b470:80bc:efed:9117%7]) with mapi id 15.20.2623.002; Sat, 4 Jan 2020 03:59:14 +0000 In-Reply-To: <83blrkj1o1.fsf@gnu.org> X-Readdle-Message-ID: 41b3e9a0-2866-4692-a35c-6d9541bc3aaa@Spark X-ClientProxiedBy: HK2PR02CA0212.apcprd02.prod.outlook.com (2603:1096:201:20::24) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: <41b3e9a0-2866-4692-a35c-6d9541bc3aaa@Spark> Original-Received: from [192.168.1.103] (1.199.245.197) by HK2PR02CA0212.apcprd02.prod.outlook.com (2603:1096:201:20::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Sat, 4 Jan 2020 03:59:13 +0000 X-Readdle-Message-ID: 41b3e9a0-2866-4692-a35c-6d9541bc3aaa@Spark X-Microsoft-Original-Message-ID: <41b3e9a0-2866-4692-a35c-6d9541bc3aaa@Spark> X-TMN: [yIESPqLaLxyadsA9+8wBr1mah17qEr8I] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 9ad744ad-505f-4f62-c9f5-08d790ca7662 X-MS-TrafficTypeDiagnostic: SG2APC01HT045: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IhXS8inU8ZHddqWmdcTdlnv5ntQHYJ8uB5IYJH+WPgla98R+Of7QBmL6wUkBK++w6LFRoHB2bFje3PgJMaXUfN+VmEuOwsBMiQPg/M2asE8xQfDmxQZQJPTHwvJA2eduRIR9eoJ+88Ugq6CeZ0hFIhBzcNSFmL8fLYHkwpcfxw93n4Gn+aE4yTmgohqS+1VVVwgezVe58y4nuS7y/04xFwLjTjEVokvT0OcAJ4vKhQk= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ad744ad-505f-4f62-c9f5-08d790ca7662 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2020 03:59:14.2462 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT045 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.253.98 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243906 Archived-At: --5e100d8e_3b1dd403_4379 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I see it also supports multi-language Documents. =E5=9C=A8 2020=E5=B9=B41=E6=9C=883=E6=97=A5 +0800 PM6:05=EF=BC=8CEli Zare= tskii =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > Would someone like to try to figure out how we could use the > incremental parsing technology in Emacs for making our > programming-language support more accurate and efficient=3F One package= > that implements this technology is tree-sitter: > > https://tree-sitter.github.io/tree-sitter/ > > A=46AIU, these capabilities could be used as an alternative to > regexp- and syntax-pps-based font-lock, better code folding, > completion, refactoring, and other similar features; in general, any > feature which would benefit from having a parse tree for the source > code in a buffer. > > To be able to use such libraries, we need to figure out how to > integrate them into the core, what kind of interfaces would be needed > for that, and what kind of infrastructure we would need for basing > Lisp features on those libraries. Posting practical ideas for design > of all that would be a good first step in this promising direction. > Bonus points for providing code patches that demonstrate the > implementation of these ideas. > > TIA > --5e100d8e_3b1dd403_4379 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I see it also supports multi-language Documents.

=E5=9C=A8 2020=E5=B9=B41=E6=9C=883=E6=97= =A5 +0800 PM6:05=EF=BC=8CEli Zaretskii <eliz@gnu.org>=EF=BC=8C=E5= =86=99=E9=81=93=EF=BC=9A
Would someone like to = try to figure out how we could use the
incremental parsing technology in Emacs for making our
programming-language support more accurate and efficient? One package
that implements this technology is tree-sitter:

https://tree-sitter.github.io/tree-sitter/

AFAIU, these capabilities could be used as an alternative to
regexp- and syntax-pps-based font-lock, better code folding,
completion, refactoring, and other similar features; in general, any
feature which would benefit from having a parse tree for the source
code in a buffer.

To be able to use such libraries, we need to figure out how to
integrate them into the core, what kind of interfaces would be needed
for that, and what kind of infrastructure we would need for basing
Lisp features on those libraries. Posting practical ideas for design
of all that would be a good first step in this promising direction.
Bonus points for providing code patches that demonstrate the
implementation of these ideas.

TIA

--5e100d8e_3b1dd403_4379--