From: "Mattias Engdegård" <mattiase@acm.org>
To: Andrea Corallo <akrl@sdf.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: master 0cbcc62: 'assoc' is not side-effect-free; constprop its pure subset
Date: Sun, 1 Nov 2020 13:56:50 +0100 [thread overview]
Message-ID: <823589BC-6CB4-4140-A442-10B5FF5870AC@acm.org> (raw)
In-Reply-To: <xjfmu01flyf.fsf@sdf.org>
1 nov. 2020 kl. 10.47 skrev Andrea Corallo via Emacs development discussions. <emacs-devel@gnu.org>:
> just ot mention, would be nice if we design this to be accessible so we
> can use it in the native compiler as well maintaining it just in one
> place.
It wasn't really meant seriously, but a simple system may look like
EFFECT ::=
nil ; no effect (subset of all effects)
| * ; any effect (superset of all effects)
| signal ; signal any condition (error etc)
| read-env ; read from the global environment
| N ; effect of function passed as argument N, N≥1
| (union EFFECT...) ; union of effects
Then today's declarations correspond to the effects:
pure ~ signal
side-effect-free ~ (union signal read-env)
error-free ~ read-env
and the effects of 'assoc' would be (union signal 3).
More fine-grained effects could be added, such as throws, mutation of arguments, reading data referenced by arguments, etc.
It all depends on what is useful for the compiler(s) and related tools.
next prev parent reply other threads:[~2020-11-01 12:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201031133156.28415.87445@vcs0.savannah.gnu.org>
[not found] ` <20201031133158.04C1220A1C@vcs0.savannah.gnu.org>
2020-10-31 15:06 ` master 0cbcc62: 'assoc' is not side-effect-free; constprop its pure subset Stefan Monnier
2020-11-01 9:39 ` Mattias Engdegård
2020-11-01 9:47 ` Andrea Corallo via Emacs development discussions.
2020-11-01 12:56 ` Mattias Engdegård [this message]
2020-11-01 14:07 ` Stefan Monnier
2020-11-02 5:40 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=823589BC-6CB4-4140-A442-10B5FF5870AC@acm.org \
--to=mattiase@acm.org \
--cc=akrl@sdf.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.