From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: pure-fns in byte-opt.el Date: Sat, 25 Jul 2020 15:58:54 -0400 Message-ID: References: <20170725020650.GA12601@holos.localdomain> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1321"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Richard Stallman , Emacs developers To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 25 21:59:37 2020 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 1jzQKU-0000Dw-PI for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jul 2020 21:59:34 +0200 Original-Received: from localhost ([::1]:44782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jzQKT-0002Bw-RH for ged-emacs-devel@m.gmane-mx.org; Sat, 25 Jul 2020 15:59:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jzQJw-0001mn-Mi for emacs-devel@gnu.org; Sat, 25 Jul 2020 15:59:00 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jzQJu-000638-J0; Sat, 25 Jul 2020 15:58:59 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0D26280D43; Sat, 25 Jul 2020 15:58:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 862A780B35; Sat, 25 Jul 2020 15:58:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1595707135; bh=R+LVd9mS/aBnml1bG/yFUCElo7sj8FiwWx0HBl4ICgc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Th5FkMAxJIFuhHA5nUhix4xjka6LXYxlgUqJdXl/f68nU8fn0S9OFGrhF9NmMtACi w4tBkNb8vpIXvKlPqjznO/5saY7+1MXVHNFvEgCA/A884IzpTVMvEdTD2xF7FmuUX5 qb/95nt/4v7FjmlsBilB1EwaqQlBXFDkKpSExVCzNQKLwyaoTXllSML/khpqVl1f8P kYXz8y4QHDy03hXDClK0lqs/kI3HzfHt4TklYm6EzXW3jIx9i0TynrF2kdgn009Xz9 ADLo7vSZlTY87DrJBqY/sILHR+aAUTGabonjrX2m3Cx6lCJs89qREbubgnbQ4uscOw 84/ffs+ylQ69w== Original-Received: from milanesa (unknown [104.247.229.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 52538120786; Sat, 25 Jul 2020 15:58:55 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Sat, 25 Jul 2020 21:53:14 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/25 14:14:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:253233 Archived-At: >> of any use. The only *real* definition is the last part: "the compiler >> can precompute the call if it knows the arguments" (where "can" should >> probably be replaced with "may", actually). > That's not a very useful definition, though, or rather, not a > definition at all, but a consequence of an as-yet hidden definition. I don't see why you think so. > It has to be possible to decide whether a function is pure by looking > at its observable behavior and its definition. The above "definition" seems to allow that: based on looking at the code you should be able to assess whether it's safe to allow the compiler (or anything else for that matter) to precompute the call. > The behavior of the byte compiled needs to follow > from the definition, not the other way round. I don't see how the above definition fails this constraint. Stefan