GNU bug report logs - #76533
[PATCH] Make cl-proclaim and cl-declaim obsolete

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Mon, 24 Feb 2025 21:27:02 UTC

Severity: wishlist

Tags: patch

Full log


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 76533 <at> debbugs.gnu.org
Cc: mattias.engdegard <at> gmail.com, monnier <at> iro.umontreal.ca
Subject: bug#76533: [PATCH] Make cl-proclaim and cl-declaim obsolete
Date: Mon, 24 Feb 2025 21:26:06 +0000
[Message part 1 (text/plain, inline)]
Severity: wishlist

In Bug#63288, we discussed making cl-proclaim and cl-declaim obsolete.
There consensus seems to be that this would be good.

The main use of cl-proclaim and cl-declaim is to enable some CL-Lib
specific optimizations by setting cl--optimize-speed and
cl--optimize-safety, and to set some byte-compiler variables.

It does seem quite strange to have such fundamental parts implemented in
cl-lib.el; if they are generally useful they should be made part of
Emacs Lisp proper and integrated as such.  If they are not, we should
just remove them.  In all cases, I think we should avoid maintaining
hard-to-understand and complex hacks in CL-Lib.

However, simply removing these CL-Lib specific variables makes the
compiled file size of eieieo-core.el (our only user of cl-declaim)
increase by almost 20%:

-rw-r--r--  1 skangas  staff  40705 Feb 24 21:31 eieio-core.elc
-rw-r--r--  1 skangas  staff  45572 Feb 24 21:31 lisp/emacs-lisp/eieio-core.elc

I'm a bit reluctant to make eieio slower, even if only a little, since
it's already known for not being fast.  So until we have a replacement
for cl--optimize-speed and cl--optimize-safety, I guess we'll have to
live with them.

Meanwhile, marking cl-proclaim and cl-declaim obsolete should at least
discourage using cl-lib for performance hacks, and hopefully encourage
more work on improving the byte-compiler instead.

The attached is the best patch I could come up with for now.

WDYT?
[0001-Make-cl-proclaim-and-cl-declaim-obsolete.patch (text/x-patch, attachment)]

This bug report was last modified 113 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.