From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Using the GNU GMP Library for Bignums in Emacs Date: Wed, 25 Apr 2018 21:17:39 -0600 Message-ID: <87o9i67j1o.fsf@tromey.com> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <83bmecy6fx.fsf@gnu.org> <0d3175d8-d996-651e-b221-71978bde3a65@cs.ucla.edu> <51e619e0-ee38-eb97-6c1d-0925b675290a@disroot.org> <55c1e23c-1b9d-1a95-c683-5bf453967c51@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1524712593 19711 195.159.176.226 (26 Apr 2018 03:16:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2018 03:16:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 26 05:16:29 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 1fBXOW-00050H-6L for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2018 05:16:28 +0200 Original-Received: from localhost ([::1]:40114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBXQd-0005Ui-18 for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2018 23:18:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBXPx-0005UN-Hz for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:17:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBXPt-0004ZM-H3 for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:17:57 -0400 Original-Received: from gateway24.websitewelcome.com ([192.185.50.73]:27801) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBXPt-0004VH-Bj for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:17:53 -0400 Original-Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 4BDD010D8E for ; Wed, 25 Apr 2018 22:17:41 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id BXPhfPkjr6il3BXPhfPcBn; Wed, 25 Apr 2018 22:17:41 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Pt8yiBhCKfU6OBJ3QCyYA2pSCbyV0mv047OoxYux75c=; b=U6px8KXzlQdw3xyZtNdfE4dXJs W0n9jhxgHofwOYOO+W8vTogzBSV5qKtpRxDJM2IrckMlor8gqSqnouOjT90ArNB7sdX8PQ9GpYjz7 w+bSCb8gis0exaZGOhNdVUaaR; Original-Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:49308 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fBXPg-003hbc-VQ; Wed, 25 Apr 2018 22:17:41 -0500 X-Attribution: Tom In-Reply-To: <55c1e23c-1b9d-1a95-c683-5bf453967c51@cs.ucla.edu> (Paul Eggert's message of "Sat, 21 Apr 2018 09:08:03 -0700") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.176.117 X-Source-L: No X-Exim-ID: 1fBXPg-003hbc-VQ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya) [97.122.176.117]:49308 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.50.73 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:224896 Archived-At: >>>>> "Paul" == Paul Eggert writes: Paul> And it depends on what we mean by "unsafe". Is it safe to assume that Paul> (eq (1+ 0) 1) returns t, for example? The Scheme standard says "no" Paul> but we might decide that 'eq' should "work" for fixnums in Emacs Paul> Lisp. That sort of thing. I would like the "egal" idea to be at least considered: that is, for immutable objects like bignums (and floats), have "eq" do a value comparison, not an identity comparison. Ideally we could dispense with eql entirely. The upside is that this makes programs simpler to reason about -- to my mind the eq/eql distinction is letting an implementation leak through the abstraction. The downside is that this is less efficient. (Currently my JIT emits "eq" as a simple comparison, which is nice; but I think on the whole I'd personally rather trade a bit of performance for the cleaner semantics.) Tom