From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sat, 4 Jan 2020 14:46:14 +0000 Message-ID: References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="106759"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 04 15:47:12 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 1inkhs-000ReI-DC for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 15:47:12 +0100 Original-Received: from localhost ([::1]:34486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inkhr-00014s-5z for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 09:47:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37289) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inkh6-0000SH-Li for emacs-devel@gnu.org; Sat, 04 Jan 2020 09:46:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inkh4-0003mz-Hc for emacs-devel@gnu.org; Sat, 04 Jan 2020 09:46:23 -0500 Original-Received: from mail-oln040092065030.outbound.protection.outlook.com ([40.92.65.30]:27622 helo=EUR01-HE1-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 1inkh2-0003eo-6a; Sat, 04 Jan 2020 09:46:22 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jxefkFtfMcuvVxAzBm1nMjwguWaminyvbE+1H7+LpdziicWJfWO7aCLy8/LGu3SrMgrAVZ2Sj4F9wNlJ7uyI1l7XPmN+ZZQrATDyYkrPf+o1WupV3vgXTzfsL/zR/o4b8Rw4OEy21/7E+h8Y6sGE8K7JI+0mQVL+oweJWDGiKRxqENekq4525aREVlAzMjCWLzYfqBxQ0PLXT0EE1TlndQs5QceeYVG9LOKFnUk0SQNleJT7ewF3mJsfFe4B/o5nLeJMHS0iEUujLrG1gzFBuzLaSXFahOMy/HiF4xcMXnCzdAlLTTvrr9Vd17QhzbRMgF8rmRFS2+m6epKMh+qNkg== 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=04qhDTdHE2OJecU+2IhMrR4lD9BgNKblCqglEwDUqrw=; b=bhaezK/UMiIdVe2BrroYDFVLHtI5bDAHHmdWnncnyl5mTP1diwV8RyHj8ttZFiKmZu4vI4geR9kb7f/GiVBiTZOCGKqV0aC545zz5I5PdzCDZ00XZhzzWN3HUF9l0DpyfOy94kPSv+ogvhZuR0cwS8zyX+M/GV09LJICA8mlvFwo66CCplbdctkDldZroigV7rxfKzzhQt9rWRdEtazvlaV8ly2TDyRnSld9RX1OwrhbePw0I9Tux6FL74pOJolxx2y9jiWgaW27H9mzGTYt/JkY6dFRJeS+FHU5tH2Gl9/EKZuKeUCpU30J6X5baz+T+D7gbxGPOOVuS0nw+c8EpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=04qhDTdHE2OJecU+2IhMrR4lD9BgNKblCqglEwDUqrw=; b=k+9YVgweW+V1xSov3vZe2bKN2aO+4a9cNcw1MxlQtykbh+JrU5ZTfN2imskpc/mOs4OcCtncpWC86KcTFCYgN+wZO/ghVYY1xOIAwWRCghaQS5pARC5jpOvM525plOw8qlAq32weorQseIUd3bUfVZAe6bkW0QAa3yVXHJOZEWdmaKXAewJs9SMLSs+pz3kRQ4HCF3AsWCCP5Z68p2VQT52xCAdkdQdf7cNKsIzqhr6Z8DSFn/ywlUQUU+9aQ1Nkb18Gatwhtzle9AwazbRhBjeuxCaNBt/djZ9h9XMaJu85bo51/pi9x6tgqdA8bBFP9Fuf8hiZU7c4Y94vymn5cg== Original-Received: from HE1EUR01FT015.eop-EUR01.prod.protection.outlook.com (10.152.0.54) by HE1EUR01HT177.eop-EUR01.prod.protection.outlook.com (10.152.1.116) 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 14:46:14 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM (10.152.0.57) by HE1EUR01FT015.mail.protection.outlook.com (10.152.0.154) 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 14:46:14 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46]) by VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46%5]) with mapi id 15.20.2602.015; Sat, 4 Jan 2020 14:46:14 +0000 Original-Received: from pascal.homepc (90.230.29.56) by AM6PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:20b:b2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10 via Frontend Transport; Sat, 4 Jan 2020 14:46:13 +0000 Thread-Topic: Using incremental parsing in Emacs Thread-Index: AQHVwh1Uy8tVxqoXLEaWXDDoUSKGMA== In-Reply-To: <83blrkj1o1.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Jan 2020 12:05:02 +0200") Accept-Language: sv-SE, en-US Content-Language: en-US x-clientproxiedby: AM6PR08CA0010.eurprd08.prod.outlook.com (2603:10a6:20b:b2::22) To VI1P194MB0429.EURP194.PROD.OUTLOOK.COM (2603:10a6:803:41::33) x-incomingtopheadermarker: OriginalChecksum:5A5E8B53D7097DA30E250DEBC3A093F01E3502D8DBAC92BD096548EBB971E99A; UpperCasedChecksum:B835019F11CF764DC2201F7BC01312C01356C0DBF0659A615A3BD53D0E16C6CA; SizeAsReceived:7472; Count:50 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [RnwPGaGjharexWKkrvmck1u9cq49ljP4] x-microsoft-original-message-id: <87lfqnmg9b.fsf@live.com> x-ms-publictraffictype: Email x-incomingheadercount: 50 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: e5c86810-e475-444c-5b0a-08d79124d8ec x-ms-traffictypediagnostic: HE1EUR01HT177: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5tQpahBLm3p29kfHsTHj9hxiB0OnELMqsHCGAlokpuFDDh/hJ0B6iT7INMXC76PnkF4U09bP+lf1mBxSpmHFvBIzT7SeWeu736Qv1Lc8eF2egymDK9htlFRzdc4NnYK4P+qgmum8nxaDwOJXNjuVUK2Zet0sHh8DqvVeOMN+lQA32JnKCuseUDF+ipDaL3w3ON0ppzmRngFdyotaziCUKHH7ToPWevezCc1h8xG9OZo= x-ms-exchange-transport-forked: True X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e5c86810-e475-444c-5b0a-08d79124d8ec X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2020 14:46:14.4700 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT177 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.65.30 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:243923 Archived-At: Eli Zaretskii writes: > 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 There is a very good presentation of tree-sitter on YT by its author: https://www.youtube.com/watch?v=3DJes3bD6P0To Looks much better then what I got a picture by just reading on the website: