Subject: Re: bug#69952: [PATCH] Support pdumping compiled queries by dumping their source

From: Yuan Fu <[email-masked]>
Date: Sat, 20 Apr 2024 01:08:15 -0700

> On Apr 13, 2024, at 12:41 AM, Eli Zaretskii <[email-masked]> wrote:
> 
> Ping!  Daniel and Yuan, any comments on this proposal?
> 
>> Cc: [email-masked], Daniel Colascione <[email-masked]>,
>> Yuan Fu <[email-masked]>
>> Date: Sat, 23 Mar 2024 09:08:21 +0200
>> From: Eli Zaretskii <[email-masked]>
>> 
>>> Date: Sat, 23 Mar 2024 03:27:18 +0000
>>> From: Sergey Vinokurov <[email-masked]>
>>> 
>>> This patch aims to allow more things to be dumped. In particular, 
>>> compiled treesitter queries can be easily dumped by storing their source 
>>> so that they will be recompiled on load.
>>> 
>>> I noticed that in my config compiled quires are created somewhere which 
>>> prevents me dumping with standard Emacs build. But with this patch I can 
>>> dump successfully and not bother finding out who produced the queries.
>>> 
>>> It seems like there should be no drawbacks in allowing more things to be 
>>> dumped, please correct me if I'm wrong.
>> 
>> Thanks.  I added Daniel and Yuan to the discussion, in case they have
>> comments.
>> 
>> And I have a question: what happens if the pdumper file dumped with
>> tree-sitter available is loaded by an Emacs session in which
>> tree-sitter is not available?  That can happen on Windows, for
>> example, if the tree-sitter library or the grammar library required
>> for recomputing the query is not available.  I think we need some code
>> to prevent Emacs from crashing on startup in that case.

Yeah, being able to dump queries is certainly nice. There will be problems if the Emacs session that later loads the query either have a different grammar version loaded, or a difference grammar library for the same language, or outright doesn’t have tree-sitter like Eli mentioned. I don’t know if they are big enough problems to give up dumping queries, though.

Yuan