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: [GNU ELPA] New package: tam Date: Thu, 21 Sep 2023 16:38:00 +0000 Message-ID: <878r8zwkgn.fsf@posteo.net> References: <87a5tjyg83.fsf@posteo.net> <87led39zyn.fsf@posteo.net> <87pm2d8d2w.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32755"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Lynn Winebarger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 21 18:38:59 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 1qjMhc-0008BZ-Vp for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Sep 2023 18:38:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjMgp-0005kP-R4; Thu, 21 Sep 2023 12:38:07 -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 1qjMgn-0005iY-T3 for emacs-devel@gnu.org; Thu, 21 Sep 2023 12:38:06 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjMgl-0004hT-M6 for emacs-devel@gnu.org; Thu, 21 Sep 2023 12:38:05 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 50DC3240101 for ; Thu, 21 Sep 2023 18:38:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695314281; bh=/EBfj/V23qXu83tB9IA0iR9oe6g01Wi2/NX+V2WtK6s=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=nphI5M7VveieBaXgtnmvhIMrmvzHTmUurtj2RTVjOOiGTw7zRN5SVWQgU7HXY4G4i rAXHQLGVn3Ee5QTu7qIRmNhNJuv9BUHrLOuotHQE3tb4iHS41Kkt3uE9ez8LBs7L3l 0Son5OQziOZZhzmNqodsDpJbfeV4hg8ftOMVUH7Mf2Qm7PA4E7a1xouY+o8F9Llb9f BMsuveV38j8wKzBMUOTDGy72C7M3Hz0y5jWBORjaOXFxlKZmi7PydQRAXhVblnvA9K UoFKcoksSD1cBxOv16c17l//b2tZK/3PiuAywlco5GhX2eQI2TwbivZjw8/axvV6GU PJfL+qhhXRDyQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rs1Kh6Kdhz9s1N; Thu, 21 Sep 2023 18:38:00 +0200 (CEST) In-Reply-To: (Lynn Winebarger's message of "Wed, 20 Sep 2023 12:14:57 -0400") 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.66; envelope-from=philipk@posteo.net; helo=mout02.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:310921 Archived-At: Lynn Winebarger writes: > On Wed, Sep 20, 2023 at 4:26=E2=80=AFAM Philip Kaludercic wrote: >> Re your last change in [0], why use records directly instead of having >> the code being generated via cl-defstruct? The commit messages doesn't >> really explain your reasoning to me. > > The library is supposed to provide alloc/free functions that run in > O(1) time to the extent that is possible for emacs-lisp code, for use > in process sentinels and similar situations. I took a look at the > byte-code generated for those two functions when using the > cl-defstruct definitions, and the accessors and setters were not > inlined. Aside from the unknown complexity of invoking those > functions, every call has a risk of overflowing the current stack and > requiring an additional stack segment be allocated. > > I rewrote the code so the only appearances of the call operator in the > byte-code of those functions is for error signaling. I also provide > an inlining version of each operation so library clients can avoid > call instructions in their code. >From what I understand this situation was resolved in the other subthread, right? >> >> I am the kind of person who thinks twice about installing a package w= hen >> >> it has dependencies. But if you prefer to use a package available on >> >> ELPA, then that is of course OK as well. > > BTW, there's something ironic about this, since you actually appear to > review most packages on GNU/NonGNU ELPA - how many users would be more > familiar with the packages that might be installed from those > archives? > At any rate, it does not depend on any packages, or even cl-lib, now - > though I have to revise the header to say so. I don't know if this is ironic or not, I just don't like having too many packages installed in general? As I said, this is my personal taste and I am not forcing this onto anyone. >> >> The question was supposed to be more general, sorry for the confusion. >> I wanted to know if there was a reason you were using setf even when >> setq would be enough, but it really doesn't matter either way since setf >> on a symbol expands directly to setq. > > If I had setf on a symbol, it was a typo. They are all gone now, > since they did not get optimized out. OK. >> No, it uses nreverse: >> >> --8<---------------cut here---------------start------------->8--- >> (macroexpand-all '(cl-loop for i to 10 collect i)) >> (let* ((i 0) (--cl-var-- nil)) >> (while (<=3D i 10) >> (setq --cl-var-- (cons i --cl-var--)) >> (setq i (+ i 1))) >> (nreverse --cl-var--)) >> --8<---------------cut here---------------end--------------->8--- > Blech, I replaced it with a simple function. Another idea could be using mapcan, but usually requires calling a lambda expression -- at which point we have firmly reached the territory of micro-optimisation, and it makes no sense to progress any further without some substantial, empirical measurements and good technical explanations behind the observations. >> These kinds of arguments lead to leftpad like situations, where people >> defer any slightly complicated functionality to a library. The last >> thing I want to see when installing a package is that it drags along >> dozens or even hundreds of recursive dependants, causing me to loose an >> overview of what I have installed and what is being installed. Every >> dependency a package brings with it (especially packages like dash & >> co.) is an argument against using it, imo. > > I don't think the leftpad situation (which I had to look up) can > happen on GNU ELPA. Even if, despite the FSF's precautions, something > had to be removed, I'm sure there would be plenty of warning. The point isn't so much that something gets removed (as you say, ELPA plays the middle-man here by mirroring the repository contents), but rather that a downstream bug or even a malicious change in a deep dependency can cause much more harm, even if the inherent utility, ie. need for the package in the first place was not that significant in the first place. > Lynn