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: Mon, 6 Jan 2020 01:44:20 +0300 Message-ID: <777ee872-c3cd-66e9-32c8-4be8d648e355@yandex.ru> References: <83blrkj1o1.fsf@gnu.org> <86zhf4gwhl.fsf@stephe-leake.org> <83tv5cgvar.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="6896"; 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: emacs-devel@gnu.org To: Eli Zaretskii , Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 23:44:37 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 1ioEdQ-0001cz-JV for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 23:44:36 +0100 Original-Received: from localhost ([::1]:46002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioEdO-0007ZO-QQ for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 17:44:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49014) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioEdG-0007ZC-4m for emacs-devel@gnu.org; Sun, 05 Jan 2020 17:44:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioEdF-00012U-19 for emacs-devel@gnu.org; Sun, 05 Jan 2020 17:44:25 -0500 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:45639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioEdE-00011Y-O6; Sun, 05 Jan 2020 17:44:24 -0500 Original-Received: by mail-lj1-x22e.google.com with SMTP id j26so49040004ljc.12; Sun, 05 Jan 2020 14:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=W/e/rsPvEWQ4XHBmlEyEj379Ebep1MbmyHH5mwEXC7s=; b=TrlHaOGo43wPNDpe7st5XaYYu4RPMK5anNxYP3z/+Cfo+wuJEyqmScjcltBdlJvPQb ISUtPIeg+/l+1s9fUU4CnzEDV8IQa2uKMAPgUuaVEJgr0cIM8eFxzjHec7jMYq5sn3VR 7iXyvLzEF/qlgjWwNiQcemKqvIkegfK4ersXAN9meMPwM0wmoztG0atQbjfqRWYUH2W+ qe7ETlWM88vLwTyy5z+S5QB2rAbVjcJaHIKvk0FCQfynieh1hmWvSH7wwJUPmO5XT5gX BTUTrvJ4TiAHH9b5Ode82V5otRORg4MnhNsroGMKrAoJAGyv05ZLF8Lbo8B/IUWBKM8X W8Tw== 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:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W/e/rsPvEWQ4XHBmlEyEj379Ebep1MbmyHH5mwEXC7s=; b=il1OSQzvM9ylSnz1Z1htDMs4NBsloy3zCsKLR1lSfMBoDgxVWFIR8koFeF83yeCTXg jEcuUgBTT+92lqedoOmxPP/Vi8ciPGGEyZfpyVljsmB0ZZ+YLPg0v5+ruaBL51YqOnkP ZY7fFMMptkXcsCRqfWrLaLKfhTM/+fAodzaQHxi16uEZFxlUflLbyqmbaJPhBX+VZda3 bUB2YKlEVu+m1NC9nAHOGYHzQr2f24joc2AVM1SgDjwc2PXrO9PrsYAmd/uBhITi2HoJ gUZi1YQ3cevcc2HJwW+GFHRF9wixTPAUKgSYcrUwxKRTZ8MuGeDiBhJQywyw+YCYaTk/ kgOQ== X-Gm-Message-State: APjAAAXty7Qm6qi8ckKbQqdXMSTaHHKCz0U+LF9FjwlejNSXBvlWkMSy tZudVPi48wfgYyRRkHu72Ab0GKY4iaY= X-Google-Smtp-Source: APXvYqxu0jhg5xFBVtCbnML+V12b159n4KxyozySlNoazMJbqaReybn51yXuUp/aQKdWKM/yI03q8A== X-Received: by 2002:a2e:9a01:: with SMTP id o1mr56009200lji.247.1578264262367; Sun, 05 Jan 2020 14:44:22 -0800 (PST) Original-Received: from [192.168.1.142] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id r2sm28076182lfn.13.2020.01.05.14.44.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jan 2020 14:44:21 -0800 (PST) In-Reply-To: <83tv5cgvar.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::22e 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:244012 Archived-At: On 03.01.2020 22:05, Eli Zaretskii wrote: > But that's just MO; I started this thread to maybe inspire someone to > have a second look on the related features and propose ways of > improving what we do today, both feature-wise and speed-wise, as I see > quite a few complaints about lack of features and slowness in stuff > like font-lock. IME font-lock is slow: - On long lines (which is hard to improve by simply implementing something in C), - In certain major modes, on particular ones in CC Mode collection. I imagine the latter is also caused by a relative complexity of the syntax in C++ and related languages, but also because, IIUC, CC Mode doesn't really do incremental parsing. syntax-propertize-function, which is used by many other modes, kind of uses that paradigm, with a certain amount of success. So the main thing I'd really expect from the new approach is "new features", i.e. ways to easier and more clearly express language syntax. Which, in turn, could entice our CC Mode developer to use it, with corresponding improvement in perceived performance. And, really, if TreeSitter's algorithmic complexity is good enough for us, it can probably be implemented in Lisp. With some critical section or two in C, maybe.