From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?
Date: Mon, 10 Aug 2020 15:39:32 +0200
Message-ID:
References: <3A9CC2A3-8307-47B2-8D80-795C0AF020E1@acm.org>
<0433A879-C98D-4B1A-B85C-A15DA9289099@acm.org>
<1621669100.2102667.1593639091621@mail.yahoo.com>
<33C2E2C8-16A6-47A9-B3A4-8A5F43648E04@acm.org>
<51FE77F3-CA05-459A-9601-9E1EEBC1E2FE@acm.org>
<1213DD41-01F9-4605-8D32-D750B6CE2B35@acm.org>
<81F989D1-3CC4-450B-89D6-E9C16F766277@acm.org>
<8371B1E5-F7DE-4CD6-977D-3D31B194C838@acm.org>
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="18075"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Paul Eggert , Stefan Monnier ,
Andrea Corallo , 42147@debbugs.gnu.org
To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?=
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 10 15:48:52 2020
Return-path:
Envelope-to: geb-bug-gnu-emacs@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 1k58AW-0004Ye-9k
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 15:48:52 +0200
Original-Received: from localhost ([::1]:48034 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1k58AV-0008Hx-AI
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 09:48:51 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49664)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1k581y-0001VU-35
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:40:02 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:51662)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1k581x-0001On-PW
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:40:01 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1k581x-00046a-NM
for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 09:40:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 10 Aug 2020 13:40:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 42147
X-GNU-PR-Package: emacs
Original-Received: via spool by 42147-submit@debbugs.gnu.org id=B42147.159706679115758
(code B ref 42147); Mon, 10 Aug 2020 13:40:01 +0000
Original-Received: (at 42147) by debbugs.gnu.org; 10 Aug 2020 13:39:51 +0000
Original-Received: from localhost ([127.0.0.1]:34975 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1k581m-000466-KB
for submit@debbugs.gnu.org; Mon, 10 Aug 2020 09:39:50 -0400
Original-Received: from mail-ot1-f53.google.com ([209.85.210.53]:46459)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1k581l-00045r-Vb
for 42147@debbugs.gnu.org; Mon, 10 Aug 2020 09:39:50 -0400
Original-Received: by mail-ot1-f53.google.com with SMTP id v6so7241167ota.13
for <42147@debbugs.gnu.org>; Mon, 10 Aug 2020 06:39:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc:content-transfer-encoding;
bh=KHo7EZUmP0zQyW9/hTZK91Kr84ERqSTXdOerElLkq/E=;
b=sUJ8Pd8t1+/1NKyFWSRyQH2LKBlgXx/lQAM70y6KF7bLe1bbncSig2BdeNEuF3XYs3
w31jvE5TA4ATazSrgJL1IVzbkvTRQvDVF7FYrQb836lufmDxqNLqMNS9IPcqMZV4FpiN
lZq82c9C3fCxWFfSQfuE+d/wEGcytKssDHS/Lh6dQ7UIds0OKBemKEBHE2gxHVFS5FCk
hWeiENgOdrrzAP6xRIMIkRiREDi67eC7FAE/R8AKldcYwx2cnfnsiGoVWuzXv9hVs+eW
g309Mb+2ZpCCW3uJbkHC441aVhLDK7fa8bZVUwSY9Y41DmwVcNx2Na1LmX7xAVm1UE2P
cZmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc:content-transfer-encoding;
bh=KHo7EZUmP0zQyW9/hTZK91Kr84ERqSTXdOerElLkq/E=;
b=VoHAHghMzRtk9w1GHsNuzRWvSkK4NMY9wqK0zYC/SKGRq7rH5ZQ5D/siexz8ublsZa
caKq33X9TEmNkuUjdWJObb/lURo0GWlOOUqL9wSQEXjDpnkFkzWhvBCoPlKrrYpzWF1L
UFI59SHngJPOOqiLuEGcX8Vs0IOlAP+Me9tvz0do68+FuAGEIFzdMj7v+R6+NlJPb8Hv
a5HoF7xU9UD+mTYxkgN7Ew5mOLveIzuoSDOPeOCIK+edGPG6Pm7SwfqBHm3HsFxrkhTJ
OfM4QFML5lb8jP3K2b/cMQqr/h1yKc16A6jcaES4MhGzbZDo6/JhMkGHHiB/oFRISx+l
FjWA==
X-Gm-Message-State: AOAM531258897j8TxgdJF6lgWn9dv3B+anl9RakSQ6elH7tayMCVN/Wu
ec/XfMWSslrvsst+QjnN5xRTyvyUO4PcOmZAEzg=
X-Google-Smtp-Source: ABdhPJwglbyNSKiYViPrWue2RSdvmdOlWXvEHDTc95Rw5+UroMnqX46z5fC1lWefy4azWn8fXV680WOn96op46lYeeI=
X-Received: by 2002:a05:6830:4032:: with SMTP id
i18mr775407ots.174.1597066784128;
Mon, 10 Aug 2020 06:39:44 -0700 (PDT)
In-Reply-To: <8371B1E5-F7DE-4CD6-977D-3D31B194C838@acm.org>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:184513
Archived-At:
Am Mo., 3. Aug. 2020 um 17:07 Uhr schrieb Mattias Engdeg=C3=A5rd :
>
> 29 juli 2020 kl. 22.39 skrev Stefan Monnier :
> >
> >> Regarding package-get-version: perhaps we should drop the 'pure' prope=
rty
> >> and just let callers wrap it in eval-when-compile?
> >
> > I'd rather not: the benefit is too subtle, I'd expect most users won't
> > know/bother to use `eval-when-compile` around it even though I'd expect
> > a vast majority of the uses can benefit from compile-time evaluation.
> > In contrast the cases where the impurity will get in the way
> > should be rare. Feel free to add a `save-match-data` if you think it's
> > worth the trouble (but please include a comment explaining it's only
> > there in order to satisfy the `pure` annotation).
>
> Thank you, I'll let you make the decision since you introduced the functi=
on. Another possibility would be to turn it into a macro again (or more lik=
ely a macro that calls a function at compile-time), or use define-inline.
>
Another option would be to create a separate function property (such
as `eval-when-compile' or `force-inline') that would force the byte
compiler to inline each call, as if surrounded by `eval-when-compile'.