From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Using incremental parsing in Emacs Date: Fri, 03 Jan 2020 12:05:02 +0200 Message-ID: <83blrkj1o1.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="132328"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 03 11:05:40 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 1inJpr-000YHh-Ku for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 11:05:39 +0100 Original-Received: from localhost ([::1]:50560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inJpq-0007z1-GX for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 05:05:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50608) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inJpJ-0007Sk-If for emacs-devel@gnu.org; Fri, 03 Jan 2020 05:05:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1inJpJ-0002rR-E6 for emacs-devel@gnu.org; Fri, 03 Jan 2020 05:05:05 -0500 Original-Received: from [176.228.60.248] (port=2080 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1inJpI-0003sd-Eq for emacs-devel@gnu.org; Fri, 03 Jan 2020 05:05:05 -0500 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243886 Archived-At: 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