From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Using the GNU GMP Library for Bignums in Emacs Date: Sat, 21 Apr 2018 17:34:10 +0300 Message-ID: <83bmecy6fx.fsf@gnu.org> References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1524321184 19075 195.159.176.226 (21 Apr 2018 14:33:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2018 14:33:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Siraphob \(Ben\) Phipathananunth" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 21 16:32: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 1f9tZT-0004r0-1d for ged-emacs-devel@m.gmane.org; Sat, 21 Apr 2018 16:32:59 +0200 Original-Received: from localhost ([::1]:48769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9tbZ-00014q-Ki for ged-emacs-devel@m.gmane.org; Sat, 21 Apr 2018 10:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9tat-00014Q-Rv for emacs-devel@gnu.org; Sat, 21 Apr 2018 10:34:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9taq-0007HY-Q4 for emacs-devel@gnu.org; Sat, 21 Apr 2018 10:34:27 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9taq-0007H9-MH; Sat, 21 Apr 2018 10:34:24 -0400 Original-Received: from [176.228.60.248] (port=2780 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f9taq-00008a-4u; Sat, 21 Apr 2018 10:34:24 -0400 In-reply-to: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> (siraben@disroot.org) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:224759 Archived-At: > From: "Siraphob (Ben) Phipathananunth" > Date: Sat, 21 Apr 2018 21:15:08 +0700 > > Emacs Calc was written many years ago, and as a result its current > implementation implements bignums purely in Emacs Lisp. Its bignum > operations also use a lot of hacks (such as performing carry > operations). Arbitrary precision arithmetic could be faster if Emacs > had GNU GMP linked to it, with the relevant Emacs Lisp functions added > in C. > > What is the consensus on linking the GNU GMP library to Emacs so that > packages such as Emacs Calc (and others) could benefit from using > native types (i.e. "mpz_t") rather than reinventing the wheel? I think the consensus is we want that, it's just a matter of someone doing the job of making it happen. The design should IMO be discussed up front, because we want not only to be able to use bignums and arbitrary-precision floating-point numbers in C, but also in Lisp. How exactly to expose them to Lisp is something we should talk about, I think. Thanks.