From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Floating-point constant folding in Emacs byte compiler Date: Mon, 26 Mar 2018 18:23:15 +0000 Message-ID: References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> <83vadmgfbz.fsf@gnu.org> <87d0zr2n1u.fsf@gmail.com> <83h8p2g99p.fsf@gnu.org> <87370m3k4y.fsf@gmail.com> <838taeg6z5.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1522088523 23715 195.159.176.226 (26 Mar 2018 18:22:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 18:22:03 +0000 (UTC) Cc: Robert Pluim , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 20:21:59 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0Wko-00062Y-9q for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 20:21:58 +0200 Original-Received: from localhost ([::1]:58412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Wmr-0005Wb-R3 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 14:24:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Wmm-0005WR-Ax for emacs-devel@gnu.org; Mon, 26 Mar 2018 14:24:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0Wml-0002mr-F2 for emacs-devel@gnu.org; Mon, 26 Mar 2018 14:24:00 -0400 Original-Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38938) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0Wmk-0002mG-03; Mon, 26 Mar 2018 14:23:58 -0400 Original-Received: by mail-wm0-x22e.google.com with SMTP id f125so17155879wme.4; Mon, 26 Mar 2018 11:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=e9KrYLVkxsT3MmKKbHJR0bwiLNvZpm7viV5xqx/Zzmc=; b=OAq4OHMZNKQ3eyATX8gjC1+zsBI79UrZ1sYEF+svotZa9DXIZ0B1zvacYuBh/40q9e dUdHs+T8UgTV3Ig/xzvKcC1KxSvTZJilZJp2E9Vrz1vpKzl5qO5V3x6gLl4zXFIyqFS0 hhBgd+Q7budGvHKEeWFc7LwJSg5TePeCIG6xMw73pG64HImA7JxW1AxobrEJ/YS6B5HS sT+AVWg77fKMX+eyigECTe3XUyRpwai1IjtfBRFPPga1Oww1f4DtM+lpvtyEI6fROV1T ThsIuPnCO7TWQMiNoWic+GFbdXOmTDOcE+onjAzcQHFB//Hxz1MBXBmiiVk/A10h3zAI Yyqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=e9KrYLVkxsT3MmKKbHJR0bwiLNvZpm7viV5xqx/Zzmc=; b=SYxLRgdT6WhdzLAYB7QZYT7aZiJRn87ASxiPquRGtuiXcIzoqx7P27KBLwakcuqJ68 Jm4QOgtmHhcrFjC33BPwUuX5ZI5ZhHpGvtTnQf4Qz8TJ7cBhJzdY+J2rvV5skSiZGhij i3IG/I8cbxIkV74fr9ZvOu3LA6WDkqedgPvfe8Vspce3gejGnqaiwDdF4xExs17SBGW6 9luYtr/dsdCfygyFkHjIT4Y2VdDeiOwRNiFk0cKD/ojr8qlP+2L87wRMtbBJCvI7w5F1 3DC1gIHYrvTziNXRuRlKW1/NlY5iKvK7lFw5txSDnoMGMyRC3ggP7uvKb/ioLzkVJOaL Ho0w== X-Gm-Message-State: AElRT7HrOljT8yZ3l5XJB3+0aaZImn1geZz3+xPkHCzF2vaus/3Jegw+ /ts2EsO4w/WFamwJw7snklMM/vMXmbwEX8jH3kY= X-Google-Smtp-Source: AG47ELs40zxKH+kM9JXvS9y5ayR6iefUsWnON5mOpPIu9RXtbGAtWh1y1vTyufDUS0dpPzJ2P3ixskwE0ZXLx20BnpU= X-Received: by 10.80.145.111 with SMTP id f44mr36107326eda.29.1522088636477; Mon, 26 Mar 2018 11:23:56 -0700 (PDT) Original-Received: by 10.80.129.230 with HTTP; Mon, 26 Mar 2018 11:23:15 -0700 (PDT) In-Reply-To: <838taeg6z5.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224059 Archived-At: Well, right now the byte code (or at least the constant vector) does depend on the machine on which the code was byte-compiled, but it's also read differently: if I understand things correctly, large integers in decimal notation are automatically converted to floats, while large hex constants signal an overflow error. I believe the former case applies to the read syntax for byte-compiled functions. But is this really a problem for any actual code? Good code shouldn't depend on more than the 30 bits Emacs guarantees, and IMHO it shouldn't distinguish between integers and their floating-point representations. In other words, I think we should specify less behavior for our numbers, not more, and keep the byte compiler simple. If code is broken for any of 30-bit integers, 62-bit integers, 32-bit integers, 48-bit integers, integers-as-IEEE-doubles, or bignums, or any combination of two of those for compilation and reading/running bytecode, that's a bug which makes it harder to play around with Emacs internals.