From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 2/2] Add module functions to convert from and to big integers. Date: Wed, 24 Apr 2019 19:28:32 +0200 Message-ID: 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> <83y33z1fnh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="109002"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Philipp Stephani , Paul Eggert , Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 24 19:30:00 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 1hJLiZ-000SDI-Pn for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 19:29:59 +0200 Original-Received: from localhost ([127.0.0.1]:44912 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLiY-0001fH-Oo for ged-emacs-devel@m.gmane.org; Wed, 24 Apr 2019 13:29:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJLhB-0001Rt-PU for emacs-devel@gnu.org; Wed, 24 Apr 2019 13:28:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJLhA-0000aW-Nv for emacs-devel@gnu.org; Wed, 24 Apr 2019 13:28:33 -0400 Original-Received: from mail-ot1-x342.google.com ([2607:f8b0:4864:20::342]:44790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJLh7-0000YE-SB; Wed, 24 Apr 2019 13:28:29 -0400 Original-Received: by mail-ot1-x342.google.com with SMTP id d24so14151392otl.11; Wed, 24 Apr 2019 10:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UxDxE5TF2IdAVM73JOLnnTyeJfPx0T4DEcjBMWUx+nI=; b=Efx7slzk1wo2zYglZx6uK3CeAmfc2Zto3VxuGnpYPA1OnlTh3cT3WMjDZfoGusUkOX wINgBatwdO/Tr8OmOtDE7R6gRYbZAe2zpSpuf+kgrLFPCMAzpSCHldF/AhKOoamAlBin XqF6hoZ+47nheFQKX4rpNj37I9aM1o0h5UgzpUUKRZCUQCHlbThzOAW3M9sdOUlyd/Mm Q2bxw+lF5ZrFV+Il8n1rY84wxymPwxqjPYhVw4aJONNiA32D6s3N3mbrYS8koR3S+dXY Cznf6drSiDEG0CTOttQ3M6R3FqAlrpaMax8M+qY676u+wL+wTISZQVOu01h6tgfBj71V 9RtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UxDxE5TF2IdAVM73JOLnnTyeJfPx0T4DEcjBMWUx+nI=; b=IEkWWTl9po4s5ohy1lyX/We0EEowXAO7zf8AqVat6Q46O0T2/4/FUzKOLTX60sCRGo HVK2t7oqc8aCNohNIEmi3LUQce1QnCkxMaiGYw1LIdM23sdm70elptHdxJ/36CezkkP/ EYwKb2UZfM4nyI7158tC1IYfsv6xxY6qxlcdZutDVItistwc/PgY4SeobOZzM2KRM0xE J6zq8WFcZfGA+Oin3WHWnnbZEL4m7ednVhvX5DclR38f9QL2GCOhY/pKxDbmiYYz2Nk4 dzgSoOlgudrfHB+FPTiTyi+ahFnfeQec+0xBJMobrCRju9YslVz5V3NcoThMqV0rQdgY 757A== X-Gm-Message-State: APjAAAXFnzNkhBtUVH729lQSap9pMLCdK+lkCOrsxhgQP5JKwTPIiPPn L7mD4rV0iQb1tbRAfc5NHJiMIslHQJFmIxtOKtLYdw== X-Google-Smtp-Source: APXvYqyZco/IKQi2gOzb1ZCL4vWsParH/h+uLRVaiA41XWkEwLuISqKvBXOb/RDxBvlMkUHpqwn42jhD/pzBp/e5iAQ= X-Received: by 2002:a9d:62c8:: with SMTP id z8mr19498880otk.144.1556126908338; Wed, 24 Apr 2019 10:28:28 -0700 (PDT) In-Reply-To: <83y33z1fnh.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::342 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:235871 Archived-At: Am Mi., 24. Apr. 2019 um 19:23 Uhr schrieb Eli Zaretskii : > > > 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? It would include mini-gmp.h instead before including emacs-module.h. I'm testing this right now, but I think it should work. > > > > 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. Still, replicating internal data structures and making sure that they stay ABI-compatible is too risky and too much of a burden. > > The problem I'm struggling with is how can we defend lack of support > of bignums in modules when Emacs itself does support them? I'd definitely prefer supporting bignums if possible. The question is just whether it's possible.