From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations? Date: Tue, 30 Jun 2020 22:27:12 +0000 (UTC) Message-ID: <1583748933.1069307.1593556032592@mail.yahoo.com> References: <1583748933.1069307.1593556032592.ref@mail.yahoo.com> Reply-To: Andrea Corallo 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="10905"; mail-complaints-to="usenet@ciao.gmane.io" To: 42147@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 01 00:28:13 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 1jqOjd-0002j1-SW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Jul 2020 00:28:13 +0200 Original-Received: from localhost ([::1]:38196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqOjc-00014u-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 18:28:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqOjS-00014N-Rw for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 18:28:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqOjS-0003T0-Iw for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 18:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqOjS-00008P-EY for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 18:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2020 22:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42147 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.1593556050475 (code B ref -1); Tue, 30 Jun 2020 22:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jun 2020 22:27:30 +0000 Original-Received: from localhost ([127.0.0.1]:51916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqOiw-00007b-Hg for submit@debbugs.gnu.org; Tue, 30 Jun 2020 18:27:30 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqOiu-00007S-EO for submit@debbugs.gnu.org; Tue, 30 Jun 2020 18:27:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqOit-0000ye-Va for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 18:27:28 -0400 Original-Received: from sonic309-25.consmr.mail.ir2.yahoo.com ([77.238.179.83]:37702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqOin-0003Ol-8t for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 18:27:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048; t=1593556037; bh=0nDH+nZl3uzPCUOMC6U/qhHVimDHrYfCbfDGuY/pROk=; h=Date:From:To:Subject:References:From:Subject; b=RUtUZzo+QhQL/hZWHV1Lc8carDznK1BqR9QTxbeAE3PmWGUCEVIWClQdgmocg5qW2JtO3XyqBe9wVQzKfiBlXWJldptRqxCsHChfrTtznwQZGPrytWMnwdfNVUL390CXrs77BUUs3EeX1QumLrddfGQS43V/LwVOhbEaCi5gIHMjajZyWlzoyVd1yxgvmwor4vvqXECo3bMlVMp9/6Se2WSOq8T5txhKyQbdz4wFXyQTNpgToPa7wf1COv0hLXF/WRNaz3+VPVUcxQ5FbN0uxDf8TokzBexNd/MHTZz1rXQ8JW45on9pOXDTR5eC0inO254uILQq3WdkqR3g/d2Kxw== X-YMail-OSG: PrbI6W0VM1mqM8xRZh993rYHQq27Sv6VaE1fNPaFg6FMW1GO4l3HpTl8c5vOBhe kuWeidJpbbLyrd5k2kmUVOySBtyh2dVKgbVds84rBUnjxyqbCOAJU9TIrp802xKQ69deYtTGpQ.W U3_Y4uUeFuhPFcA_IB7LcmzVFHlXpTebm0bQr_k8UALItfiYX4KM1XDM5LbjPIKDFIMmo4qdC.86 fdJ9XCkbgtr7IqyOnYnVQ3tI177C0uJpzgdZSCZ.HEmMe_DGkcVF8VHMYDFl758ixvBTBfZfddK. POJZXJbdE64nqIyB45b_atn.79Qn1rLvVJftaVJUVSTcOCI5uTKA0pR..dn5gd_1gC8ef2UmbB7J gp0q76p8MsT2xGtDCT6jl27UCuFx0fY5imQIhQ7RpCTvlpALMRXQgxa3wk8Zuo2tE_dWCAUOkNCf 8zSB.hx8N70jF9W9Q9ChYYM3W5esCVtGWD98DeObnOQYwlzKVh7KYy7gKrckuFop0lfR9lmUkOTa rGX2KElyXhQBHnByu43NlQJR9mqzblC1lypjEamYvyJH4MkqXULUGQ8eD0Inamv8Okv8bktc5s2W Fw4hWW3gItN7iEnK.ivjOF4NiNFcxgneK3_XodbyKF36hNzSOQsVgxSqMuFZqBY.6kEGtt9eCLkF iaSwez8oND6YRz1QzM1gttz7eihg81TuRgZcsoaoG3m2uTbzXhV8u9C2VTTqYs7z1kvTUGrVaWD6 Olroo8j3tBQqQ9yh4fou7i9HYJTh..jeysDAZ9D1HAHydCWBypqI6QqDz_7nyY8maudgBljHu6cp Oxmg.SxgBEdmsJXmonorf2AfwLpMSNWjQDG0znV1TS Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Tue, 30 Jun 2020 22:27:17 +0000 X-Mailer: WebService/1.1.16197 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0 Received-SPF: pass client-ip=77.238.179.83; envelope-from=andrea_corallo@yahoo.it; helo=sonic309-25.consmr.mail.ir2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 18:27:17 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:182590 Archived-At: Hi all, I was looking in byte-opt.el to how are classified a number of functions. My understanding is that pure functions should be technically a subset of side-effect-and-error-free for which the environment has no influence on the value the function evaluates to.=C2=A0 For this reason they can be constant folded in the compile time if possible. Now in pure functions I see we do not have a lot of functions that (to my understanding) would classify for that.=C2=A0 I'm thinking to simple predicates acting on immutable objects as consp or fixnump to give an example. Shouldn't we move these into the pure class? ATM for instance this does not get optimized: (defun foo () =C2=A0 (fixnump 3)) In case this makes sense I'll be happy to work on it and prepare a patch. Thanks =C2=A0 Andrea