From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter (severe performance issues together with linum-mode) Date: Mon, 5 Sep 2022 19:53:26 -0700 Message-ID: <83026cfc-8a85-9939-bab4-5b60d4812af9@gmail.com> References: <7e24d0aa-9980-6204-5064-5a92963ae7bd@secure.kjonigsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25970"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 06 04:54:25 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oVOjI-0006cw-4L for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Sep 2022 04:54:24 +0200 Original-Received: from localhost ([::1]:40244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVOjG-00087K-Cm for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Sep 2022 22:54:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVOiR-0007Pm-Ma for emacs-devel@gnu.org; Mon, 05 Sep 2022 22:53:31 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:44630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVOiP-000140-Uu for emacs-devel@gnu.org; Mon, 05 Sep 2022 22:53:31 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id c24so9398034pgg.11 for ; Mon, 05 Sep 2022 19:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=NjbsBjTMw+zNIocv1pogCDmX5DxTbpBZEw5goz1xE+Y=; b=kCR8ScTM7aTdkYbElKp189xqBhYuZ5Yu0YVM+I9cXQ/CxoO1IyHGfiVtv/ta8dP7vR fM5LWZ9IiS9QShqtlPRu7zu7OsxTsEE0UXcFmrF0dBb171FMAux6n6VAGR54SUeD9snY /PUqP5MX/rKGgK2/dqW+H7twyaVh9or1Jm3ZMsw/db8gBfniSarwTdibTcIoskONF4gP iqCwfpODTRcuKqRsBNUmxJ8TL771eFRBZCLWaVE1sbijnwXI+xXIGtgMsMSZ4ICaV+Q2 VpUUK1v2Cnz1hiqR9vBBOYlsmui/RBrkgKN6snzxyVeZq3rMeRPABADO8pPPTJkVoeFg Jcmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=NjbsBjTMw+zNIocv1pogCDmX5DxTbpBZEw5goz1xE+Y=; b=UxKrvgK73Cd7uzv2bUbjm77Lhk+q1u5glb7NJDVoT7WZ07nTeDVjEiBvazuwiq2x3U DPBi43RHwlQKIJ+cLmu999uLGFPkgGJO0ZV8/AYBVZbreDqspacVxJ4xrMXvGSygkR/h 7z4miXuEfESj/jPujvJFd8KbDCFPzsr6vuC+Q+FngG16CpGQBmQLbyf2ay3lKwCqmVYw rpWi/ZZZmqOuxVqrIhKOpofjjO2nQDmR8MT7dIRpaGcusJB54UsNP+uoGTJfm5/o4v5b ncffh98Uad//60TjBrBSzoSMaYzmrvaEyNhoNI1xQWgBVpcE6PnDm/97Q+Cce/yy70xM U5gQ== X-Gm-Message-State: ACgBeo3tXvRS8FG4uhUO8hosyv07bdEmP0X8qckn2Lv/6K7sKzzAHfMJ ohYp3K+R2CR8JhL8MqTAKehAiVj1Kf0= X-Google-Smtp-Source: AA6agR4q8YanmQ10cvqZqeSLsJ1I6Q2EfvpCQn4RYWyCIorgaGVVZfeFrQmIRZFaDTdLmSBa5QtGLw== X-Received: by 2002:aa7:910b:0:b0:537:cd65:e7d with SMTP id 11-20020aa7910b000000b00537cd650e7dmr51377948pfh.63.1662432807784; Mon, 05 Sep 2022 19:53:27 -0700 (PDT) Original-Received: from [192.168.0.10] (75-164-207-85.ptld.qwest.net. [75.164.207.85]) by smtp.gmail.com with ESMTPSA id i12-20020a17090a718c00b001fb53587166sm7573065pjk.28.2022.09.05.19.53.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Sep 2022 19:53:27 -0700 (PDT) Content-Language: en-GB In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=cpitclaudel@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.716, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294768 Archived-At: On 8/20/22 07:14, Stefan Monnier wrote: > FWIW, I think specifying the highlighting rules with something akin to: > > (defvar ') > > is a mistake. It should go through some kind of macro, such as (maybe): > > (defvar (tree-sitter-rules )) > > which can thus do any preprocessing we may want, such as pre-compiling > queries. It also helps evolve the syntax since we can more easily warn > about obsolete uses, etc... > > I've had a "rewrite font-lock.el so the rules go through a macro" in my > todo list for ages. We do things this way in Flycheck, but we've been bitten a few times by the way this pattern interacts with `with-eval-after-load`, so I would be careful about adopting this pattern in tree-sitter (unless we expect it to be preloaded). In fact, I think your suggestion back then was to *not* use a macro? I can't find the exact thread, but this is close enough: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00820.html :)