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, 11 Jul 2018 22:51:09 -0600 Message-ID: <877em1cb0i.fsf@tromey.com> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <83bmecy6fx.fsf@gnu.org> <0d3175d8-d996-651e-b221-71978bde3a65@cs.ucla.edu> <87tvpdnzgy.fsf@tromey.com> <4c2a814f-c254-29e5-39cf-11b5f2e5c9c8@cs.ucla.edu> <49d8ba62-c9a5-9203-d882-8e900b441ff3@cs.ucla.edu> <8e0320d9-e0d0-2b57-57cc-2df4399f133c@cs.ucla.edu> <87lgaio7xd.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531371004 10298 195.159.176.226 (12 Jul 2018 04:50:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jul 2018 04:50:04 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: Tom Tromey , emacs-devel@gnu.org, monnier@IRO.UMontreal.CA, eggert@cs.ucla.edu To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 12 06:49: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 1fdTYE-0002Vy-Py for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2018 06:49:58 +0200 Original-Received: from localhost ([::1]:57339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdTaK-0007BL-Cr for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2018 00:52:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdTZg-0007BB-9N for emacs-devel@gnu.org; Thu, 12 Jul 2018 00:51:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdTZb-0000St-Ct for emacs-devel@gnu.org; Thu, 12 Jul 2018 00:51:28 -0400 Original-Received: from gateway20.websitewelcome.com ([192.185.55.25]:28311) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fdTZb-0000LV-6h for emacs-devel@gnu.org; Thu, 12 Jul 2018 00:51:23 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 60B58400D02B5 for ; Wed, 11 Jul 2018 23:51:10 -0500 (CDT) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id dTZOfvC6KSjJAdTZOfjIbe; Wed, 11 Jul 2018 23:51:10 -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=cDvYiyEKWUo2h5BFRr2xoKWAOvkDSx99T7gnYvNmxp8=; b=f6mpJ2GjHbpDKIk8we2MRImaoc G+cPhiVGJYSRG8FTAq7EjcYXTVPCoRnQQAQIC8u3ToVwxRVhexdglzxUoVdJT+3FYLHBpES/s6/lL OlZvpTYd26wzJlpEY7RnzH4Y6; Original-Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:57110 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fdTZN-0038nf-Ug; Wed, 11 Jul 2018 23:51:10 -0500 X-Attribution: Tom In-Reply-To: (Richard Stallman's message of "Wed, 11 Jul 2018 18:48:42 -0400") 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: 75.166.85.72 X-Source-L: No X-Exim-ID: 1fdTZN-0038nf-Ug X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-85-72.hlrn.qwest.net (bapiya) [75.166.85.72]:57110 X-Source-Auth: tom+tromey.com X-Email-Count: 13 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.55.25 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:227269 Archived-At: >>>>> "Richard" == Richard Stallman writes: Richard> [[[ To any NSA and FBI agents reading my email: please consider ]]] Richard> [[[ whether defending the US Constitution against all enemies, ]]] Richard> [[[ foreign or domestic, requires you to follow Snowden's example. ]]] >> Well, for one thing, it's simpler to explain that there are just >> integers. In fact after working on the docs for this I think it would >> be better if bignums were interned so that eq would work. Richard> Simplifying the documentation is often a good reason to change the Richard> Emacs Lisp language. But it is not automatically decisive. In this Richard> case, there may be important advantages on the other side too. Yeah, I just don't know what those advantages are; or maybe they were explained and I missed and/or did not understand them. Speaking of downsides, I think there is at least one downside of making 'eq' work for bignums, which is that it is slower. One way to implement this would be to intern each mpz_t in some sort of weak hash table. This isn't hard to implement but it means a hash lookup whenever converting a bignum to a Lisp object. Another way would be to add a special case to eq, though as you said earlier, this would slow down eq. I don't know which would be better and I haven't implemented either one. Instead I plan to push my branch to savannah soon, and then I will send out an email and everybody can take a look at it and see what they think about the documentation and the implementation. Tom