From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Siraphob (Ben) Phipathananunth" Newsgroups: gmane.emacs.devel Subject: Using the GNU GMP Library for Bignums in Emacs Date: Sat, 21 Apr 2018 21:15:08 +0700 Message-ID: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1524320018 9178 195.159.176.226 (21 Apr 2018 14:13:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Apr 2018 14:13:38 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 21 16:13:34 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 1f9tGd-0002De-EC for ged-emacs-devel@m.gmane.org; Sat, 21 Apr 2018 16:13:31 +0200 Original-Received: from localhost ([::1]:47690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9tIj-0004HJ-La for ged-emacs-devel@m.gmane.org; Sat, 21 Apr 2018 10:15:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9tIa-0004Gz-PL for emacs-devel@gnu.org; Sat, 21 Apr 2018 10:15:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9tIX-0003Is-DO for emacs-devel@gnu.org; Sat, 21 Apr 2018 10:15:32 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:36960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f9tIX-0003Ew-36 for emacs-devel@gnu.org; Sat, 21 Apr 2018 10:15:29 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id DC61F2DD91; Sat, 21 Apr 2018 16:15:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1524320125; bh=RZHPFHvnQc5stvC4MMIp8xYe3fgCHOuLrsYToZxQWG8=; h=To:From:Subject:Date; b=q2b+nMIX5HNttTj6HiR00P1ccJGYWmI8LsDd2fxFFUGRLV7uouRirHcPpmSzByLJY ODYBYl1MNKTx5m88Gg+E3xgnxU1/oHq2BTRl6x1TtFyBsceNv1mgd7FRBWmED11Rhv 6an4hrKyMigAa18na+/wtjcN4uaPVxxfK/XO7GBfSW3i83bz349eRiPOu4cLSSr0be MiDz5YgSs2zg4fLL8X3cI1fnwr9Bx5W7q4VWKi3HmxurYVtIMWiepMvYXkfSLXOOFV prhx7UkatR0qRdy9J0+jSGQURBr9mLIfhA6aBJCIUFG2e4hkp9hqVAuJadWZ9Ih5Vm 5Xu96HjlB25rg== X-Virus-Scanned: Debian amavisd-new at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (mail01.disroot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GtySk1AOG_oI; Sat, 21 Apr 2018 16:15:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1524320112; bh=RZHPFHvnQc5stvC4MMIp8xYe3fgCHOuLrsYToZxQWG8=; h=To:From:Subject:Date; b=Z4OKRrYK+kZZ1PuK6T6a45p7txWOsfnV72yZjLnU5bjCR57K78Dm+fYWzMSpia73Y 9kGQ+8j6jyhEniWcMV6bSKYeZNggf5i0EwZPnV9A1u8u/7pbLkbh1FVQKYuLoI+2ES 3x1Ev/mVZVUu2+nGcbNdN/BWwhaa558QdZ4JnKcvHbRpJcI5VeqBqFM/RKd4LyMqA8 r9wZvxthAs9vQ0GW1Dko9YSxS2ahZIC67/z+3KIVqwjknDIvd9k/EZY/i9APfczJi8 aSJB3V777BtOLZ3e6jFw0U2XQj2fBUx4owmdP0MkLpDCbzoK7vhibVmwXKwLEQY1Up 3vv71czJv/QVA== Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.21.23.139 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:224758 Archived-At: 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? The benefits of linking GNU GMP are clear. It would make it easier to extend the math capabilities of Emacs, while making it faster and less error-prone. However, the downsides, if any exist, should be discussed as well, to gauge whether pursuing such a task would be fruitful.