From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: phillip.lord@russet.org.uk Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Fri, 03 Jan 2020 13:36:39 +0000 Message-ID: <219378dd013891dcaba73de18c189f7e@russet.org.uk> References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="230733"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Roundcube Webmail/1.3.8 Cc: Emacs-devel , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 03 14:38:17 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 1inN9c-000xsz-HS for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 14:38:17 +0100 Original-Received: from localhost ([::1]:52410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inN9b-0004LR-Cn for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 08:38:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47201) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inN8s-0003uA-CH for emacs-devel@gnu.org; Fri, 03 Jan 2020 08:37:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inN8q-0003Ma-Fj for emacs-devel@gnu.org; Fri, 03 Jan 2020 08:37:30 -0500 Original-Received: from cloud103.planethippo.com ([78.129.138.110]:34440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inN8l-0008Ct-Ie; Fri, 03 Jan 2020 08:37:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Message-ID:References:In-Reply-To:Subject:Cc:To :From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=As0TD63TUNuUeRoDZIPVCxLZnwJGGPykcZcZ8Ra3tXE=; b=jy4iISgOCxWFhPl6NVEQfJQX6u fT9Agod29dB1MPfzu/YrZzD35/c+oZk0Z9Y84b3VYE66jPESc4phzZi4vGya5nm2oGGALi9OTEVz+ cWLu3ZuOeCLFRlfZPjtNU1/bcQsvm5SUIYohVK4fRnmAYr/cRVK/EhRcyt3GCghm5VLdQfxlmtMWN 5L7+c0cH8KaJqOFIHe9ZaF2krwh1ZDfJlFTg8z9hPqsydOS+Uza/baeYD/2dom8vcbqgjDwTmtxnt W0NgEI5613Trb0E3Ka6lHbkdMUiU1OLdpS79KKUjT2uVNqK7FXWVl7IMh2HwE3n/edhaB6qO+68qx Q3kdfYfw==; Original-Received: from [::1] (port=34322 helo=cloud103.planethippo.com) by cloud103.planethippo.com with esmtpa (Exim 4.92) (envelope-from ) id 1inN83-0001YP-C4; Fri, 03 Jan 2020 13:36:39 +0000 In-Reply-To: <83blrkj1o1.fsf@gnu.org> X-Sender: phillip.lord@russet.org.uk X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 78.129.138.110 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:243891 Archived-At: Think it's already being worked on. https://github.com/ubolonton/emacs-tree-sitter/ https://github.com/karlotness/tree-sitter.el The former uses Rust for the dynamic module support. Tree sitter itself also uses Javascript and npm to define the language grammars, although AFAICT, these compile down to C. On 2020-01-03 10:05, Eli Zaretskii wrote: > 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