From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Fri, 3 Jan 2020 19:00:39 +0300 Message-ID: <91f634b6-ea3a-2681-39b8-bda6a3796399@yandex.ru> References: <83blrkj1o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="44007"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: Stefan Monnier To: Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 03 17:00:57 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 1inPNg-000BD0-7b for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 17:00:56 +0100 Original-Received: from localhost ([::1]:53858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inPNf-0006Gt-3N for ged-emacs-devel@m.gmane.org; Fri, 03 Jan 2020 11:00:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47805) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inPNU-0006EN-KG for emacs-devel@gnu.org; Fri, 03 Jan 2020 11:00:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inPNT-0008MJ-BO for emacs-devel@gnu.org; Fri, 03 Jan 2020 11:00:44 -0500 Original-Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:43049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1inPNS-0008LD-UT; Fri, 03 Jan 2020 11:00:43 -0500 Original-Received: by mail-lj1-x242.google.com with SMTP id a13so44310769ljm.10; Fri, 03 Jan 2020 08:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hkJQOEgj+wGPPfPVDhm0HSOuDidNLjLFCLhOkyiVVVE=; b=Q+HH/ApRb2eoO1XGkNL2SP0nBuj+Pv8YcA1JJv2fclh77OoIsDbkSX77Vxph3BRJZf GKRc4WkBOr1qKgAXKFM8GzkfGY++JyeVhCaIoSXsTCujGnyJ86lRYexqhrmiU7x/Ucok KjObIjARinGzMeBTIX2cNy3Rlu7+jtvI+MCLryuI53akNa8enRZypdYoPbGlm4ObLqXI yG0tGWsspw9gO/u4ualttVT4G8iog9R+2DYRyvna57eiHmin0VURqJGtUkR4oH4fV7Zf kx5djLA9HkQcokeVU8POETMqjD1zxoGl/Sd7cTVbE9l7b8amm13TCmm2NeI1DW8db2Fp 7oDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hkJQOEgj+wGPPfPVDhm0HSOuDidNLjLFCLhOkyiVVVE=; b=Ci4LitnMlybGtV0OgRpDKkWGfEs0YAlnBtgd5AznVec4bvpWc9Jn17z6Td5h1ocNAp 7j+LCCm1GDdePZTi2tZFalwncgKBadWv+QdNwd/qnBy6+gVCeFqlczIHpVqRq8mJ2mJs uwCK4feAA3crC6UlR037PM+YOjUBBRILRcGscdL8NevSZIiqFajnTlp7oEe0p7BdFE4E 8o6UK66WyRhh0BLFhMOzqUZ8AE4eUJmzkek3ENico+RYGAinmT6KiLb0R6uhrnk5AXsx NEo6nRGdu9aTbtQLXHPI31e6NRCbFAz6x2nFNAn5rH+s+W3WEMCMmmq4tCTGmwo4trwo 1GmQ== X-Gm-Message-State: APjAAAWtRsDBLJSmwomXw96pVM3Qx0AcISB15vW9fPMbP6GVcnSDEZTO ulQV/sp0lh6jz3Hg6McfZLY= X-Google-Smtp-Source: APXvYqwMjbZ5CvimER8IMfEcG1Y7FSwsVcyPOEIGDEC2qmQKTICxtl5wZuHgQclwnTAGmM3RVsn7tg== X-Received: by 2002:a2e:b0e3:: with SMTP id h3mr4072968ljl.56.1578067241407; Fri, 03 Jan 2020 08:00:41 -0800 (PST) Original-Received: from [192.168.1.142] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id l64sm25004566lfd.30.2020.01.03.08.00.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jan 2020 08:00:40 -0800 (PST) In-Reply-To: <83blrkj1o1.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 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:243896 Archived-At: On 03.01.2020 12: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. Quite some time ago we talked with Stefan about supporting certain complex language features, and kind of agreed that we could use a new way to specify syntax, something to supersede syntax-propertize-function (and maybe font-lock). Tree-Sitter could be an example of how such new grammars could be structured, but I think we'd need that implemented in Lisp. Not in a foreign library that we import through modules mechanism.