From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Preferred approach to inclusion of data in ELPA package Date: Thu, 17 Aug 2023 21:14:08 +0000 Message-ID: <878ra91ie7.fsf@posteo.net> References: <28956ffc-6cc0-1f39-a26b-1453b48d61b1@hugot.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16865"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Hugo Thunnissen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 17 23:15:15 2023 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 1qWkKp-0004Bp-8n for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Aug 2023 23:15:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWkJw-00038R-1b; Thu, 17 Aug 2023 17:14:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWkJu-000380-AK for emacs-devel@gnu.org; Thu, 17 Aug 2023 17:14:18 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWkJr-0005tl-9O for emacs-devel@gnu.org; Thu, 17 Aug 2023 17:14:18 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9DCF1240027 for ; Thu, 17 Aug 2023 23:14:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692306850; bh=5ajCXhZitswb0b29Eu2TnJ4TUVESLfK4ztFcUJxgKgc=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=RTSSIGco2HZ8JlINiuAF7rLD/bU0rW/XCW2YgyGeMH49WLORlyUZecMHbzDydNLLl DanXy4Tt6Mbr196kl0ErapEGxpk6QcuF43ltOS43p0nP96NvmaFWwH9x48Xu930TPF sJglJ9FSwbjQPrXD9OWfE5N9uAKMyoveqOaxIVJtrhxrFfUkNhiQCBeXD4uo3R422a htBPY5iFBimvpeBL9wz5Ep+D1M///GImesmPOXTgl2oFL/sPFjmoQgHkTbVbIeIh9K O0BrlgyVHaAo1r6k9+/lcYr+y7yneNeJ3EX0X8476HPenDrhV/ANhPQ5ILi3KXY4aC jZNoTE3aAmavQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RRd6T6pjhz6txJ; Thu, 17 Aug 2023 23:14:09 +0200 (CEST) In-Reply-To: <28956ffc-6cc0-1f39-a26b-1453b48d61b1@hugot.nl> (Hugo Thunnissen's message of "Thu, 17 Aug 2023 15:58:32 +0200") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308878 Archived-At: Hugo Thunnissen writes: > Hi all, > > For my package phpinspect.el I am now looking into the creation of an > index of PHP's built in functions and classes. I'm considering > different ways of distributing this dataset, but I'm not entirely sure > what would be the preferred way. Finding out the signatures/properties > of built in functions and classes is straightforward: I can generate > valid PHP stubs for them which can then be parsed an indexed by my > package just like any other PHP code. What I'm not sure about is what > the best way would be to distribute this data. Options I'm considering > are: > > 1. Distribute the stubs with the package and parse them each time > **when the package is loaded**. > > 2. Parse and index the stubs, then serialize the resulting index into > a gzipped lisp data file that is checked into version control, and is > loaded **when the package is loaded**. (BTW, should such a .eld file > be byte compiled for any reason?) > > 3. Parse and index the stubs, then serialize the resulting index > **during compile time**. Either by generating lisp code using a macro, > or by serializing the index into a .eld file. This guarantees the > index staying up to date with the contents of the stub files whenever > the package is compiled. > > Some more info: I expect the initial dataset to be a file with about > 2000 stub functions and 200something stub classes, but it will grow as > PHP grows and as phpinspect starts to cover more of PHP's features > (for example, constant variables may also be included at some point in > the near future, growing the index by a bit). I guesstimate that it > would take less than 300ms to parse a set of files like that on most > modern hardware, but I don't have the benchmarks to back that up yet. > > I'm personally leaning towards option 3 and using a macro during > compile time, but I could be nudged either way. Which approach would > be preferable and why? Is there a common practice for things like > this? Another idea is to have a Makefile generate the file, like the one you describe in option 2., that is generate whenever the package is built and bundled into a tarball for distribution. That way you don't have to store a binary blob in your repository, and you can avoid burdening the user with additional computations at either compile or runtime. Does the generation require any special functionality/tools/code to be provided on the device the index is generated on? > Thanks, > > - Hugo