From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 2/2] Add module functions to convert from and to big integers. Date: Wed, 24 Apr 2019 20:23:14 +0300 Message-ID: <83y33z1fnh.fsf@gnu.org> References: <329aec43-8272-f39a-e7ef-e77804103a50@cs.ucla.edu> <20190423213218.35618-1-phst@google.com> <20190423213218.35618-2-phst@google.com> <837ebj2xx0.fsf@gnu.org> <83zhof1g76.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="106724"; mail-complaints-to="usenet@blaine.gmane.org" Cc: phst@google.com, eggert@cs.ucla.edu, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 24 19:29:33 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJLi9-000ReA-2Y for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 19:29:33 +0200 Original-Received: from localhost ([127.0.0.1]:44884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLi8-0001EA-1J for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 13:29:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLgu-00018K-Tt for emacs-devel@gnu.org; Wed, 24 Apr 2019 13:28:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLc8-0002dz-0s; Wed, 24 Apr 2019 13:23:20 -0400 Original-Received: from [176.228.60.248] (port=1719 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hJLc7-0000ix-5Z; Wed, 24 Apr 2019 13:23:19 -0400 In-reply-to: (message from Philipp Stephani on Wed, 24 Apr 2019 19:15:13 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:235870 Archived-At: > From: Philipp Stephani > Date: Wed, 24 Apr 2019 19:15:13 +0200 > Cc: Paul Eggert , Emacs developers , > Philipp Stephani > > > > 1. Don't support these functions at all if GMP isn't available (i.e. > > > signal an error unconditionally) > > > 2. Add another preprocessor macro that would stop emacs-module.h from > > > including gmp.h. > > > > > > (1) seems a bit easier and cleaner, but means that we wouldn't support > > > these functions if Emacs isn't compiled with GMP support. > > > > I don't think I understand (2): how would you declare GMP-related data > > types used in emacs-module.c, if you don't include gmp.h? > > It would require the user (or rather, Emacs) to include gmp.h or > mini-gmp.h before including emacs-module.h. I.e.: > > #ifndef EMACS_MODULE_DO_NOT_INCLUDE_GMP_H > #include > #endif Ah, okay. But then what would emacs-module.c do with these 2 new APIs if gmp.h was not included? > > And there might be option (3): have emacs-module.h duplicate the > > portion of mini-gmp.h that are needed when gmp.h isn't available. > > It's a bit inelegant, and maintenance burden, but maybe not grave > > enough to decide that wer cannot support bignums without a real GMP. > > I don't think we should replicate internal data structures of > third-party libraries. It's really ugly. mini-gmp.h is not third-party, it's Emacs. The problem I'm struggling with is how can we defend lack of support of bignums in modules when Emacs itself does support them?