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: Sat, 25 Jul 2020 22:03:03 +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>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="19205"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= ,
Paul Eggert , Andrea Corallo ,
42147@debbugs.gnu.org
To: Stefan Monnier
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 25 22:04:09 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 1jzQOv-0004sR-Hs
for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Jul 2020 22:04:09 +0200
Original-Received: from localhost ([::1]:46552 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1jzQOu-0003Ej-Jy
for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Jul 2020 16:04:08 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46974)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1jzQOo-0003ES-E1
for bug-gnu-emacs@gnu.org; Sat, 25 Jul 2020 16:04:02 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:39657)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1jzQOo-0006ts-2L
for bug-gnu-emacs@gnu.org; Sat, 25 Jul 2020 16:04:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1jzQOn-0002A4-Ui
for bug-gnu-emacs@gnu.org; Sat, 25 Jul 2020 16:04: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: Sat, 25 Jul 2020 20:04: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.15957074088265
(code B ref 42147); Sat, 25 Jul 2020 20:04:01 +0000
Original-Received: (at 42147) by debbugs.gnu.org; 25 Jul 2020 20:03:28 +0000
Original-Received: from localhost ([127.0.0.1]:51203 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1jzQOF-00029F-Jv
for submit@debbugs.gnu.org; Sat, 25 Jul 2020 16:03:27 -0400
Original-Received: from mail-oi1-f194.google.com ([209.85.167.194]:36725)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1jzQO8-00028v-56
for 42147@debbugs.gnu.org; Sat, 25 Jul 2020 16:03:22 -0400
Original-Received: by mail-oi1-f194.google.com with SMTP id s144so1130710oie.3
for <42147@debbugs.gnu.org>; Sat, 25 Jul 2020 13:03:20 -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; bh=9jWMODdMVeipg9JBt6ZFVJwbKsp1WIhtQD/ZbOtf2NI=;
b=LWRymqA+5Ugi7oeXlbkb2PTC0j9WWvSTZBiKB9YbLU3wyxZMAYdKhjoJdt/d5lT9I9
moq6fTquVGdar9oJ29V/G5SbzqtaHlaF9VlFqzv3JbXil1nNkgyNDTWSxmlQ9iGN8xM4
WSgkQapOhxD7NOrKhujayqbi5Ss3ACBYoR//R8JE6MEZdw3WugLXhL/TtInnX8aUoLTh
psaFa8ZLBWFcpM8rfQMjZHE8LcOjihXJzf29W7Il7y+/gKgmoNlPCR1LICQQGN1CUxzz
im2xoQ2qz6HItJCjIi7QVFD2vRL2/GaIg33jUKgdiyj0GMotKVYr7b0Z0FaIsMyI7ixZ
Kpiw==
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;
bh=9jWMODdMVeipg9JBt6ZFVJwbKsp1WIhtQD/ZbOtf2NI=;
b=ZdgVHAN/kWwRsTKtzzVbvpvPolp42tToPtZrrxLFkIuLyp+jcMmf5bqn5gVflmnLjV
HThM7Gg2C9DfvO/ZrXTmEEjrrVNWv/3eeJzvEXYqqZcScEDNVKze2jh57oki/CxjRs+V
TtbTMuyfiRl0S644Ys8VUFLRq4UMMSoF7fN9YPfcOfHVZOoN/Fp/hn45JAsnhAnWQ4Vy
rgncKfRffNs7E9VoAyvnEYMzmRF8pMsnjLqolPxaSDOyjZIBUvhgh7zG4qKvY1IwlQ07
brb8Gre7fTMOAAV2T+b4o3ts0OY4JAOHnLLWBsIHPoJfCms2ukyNv+qIq9j0dWFImada
m3xQ==
X-Gm-Message-State: AOAM532AceTeX1hXDTEVLmssfU2JQVwPPQAu9s3M0S+LIxHa8kts0rf+
Rd/NyScoOH/kFe/iX7w2Zn6DEDF3qt8M/H4mOj8=
X-Google-Smtp-Source: ABdhPJwuXZsiLdOKccrD/daDOFWUqKM/fBp340nTbOf7ZUcWqNu8LfJcEoqU3a/tEfp5tfbKQfKBJtsvADEAL2Vyh8A=
X-Received: by 2002:aca:54d3:: with SMTP id
i202mr12930736oib.170.1595707394364;
Sat, 25 Jul 2020 13:03:14 -0700 (PDT)
In-Reply-To:
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:183548
Archived-At:
Am Sa., 25. Juli 2020 um 20:10 Uhr schrieb Stefan Monnier
:
>
> > and "side-effect free" is like GCC's "pure." That is, a side-effect
> > free function can dereference pointers stored in Lisp_Objects, but a
> > pure function can't.
>
> I think it's still not very satisfactory since it's written in terms of
> low-level operations in the C code.
Agreed, I'd rather think of this hypothesis as a first step towards a
definition that we can put into the manual.
>
> I think the current intention of our "pure" goes something along the
> lines of: the function will always return the "same" (the sense of `eql`)
> value (or signal the same error) when called with `eql` arguments.
> IOW "the function preserves `eql`ity".
>
That sounds like a very reasonable definition. Do you think it's
equivalent to my hypothesis and/or to the current behavior of the byte
optimizer? Is it a complete definition in the sense that it gives an
unambiguous yes/no answer for every current and future function?