[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] Add module functions to convert from and to big integers

From: Philipp Stephani
Subject: Re: [PATCH 2/2] Add module functions to convert from and to big integers.
Date: Tue, 23 Apr 2019 17:12:03 +0200

Am Di., 23. Apr. 2019 um 16:51 Uhr schrieb Paul Eggert <address@hidden>:
> On 4/23/19 6:17 AM, Philipp Stephani wrote:
> > address@hidden Function bool extract_big_integer (emacs_env address@hidden, 
> > emacs_value @var{arg}, int address@hidden, ptrdiff_t address@hidden, 
> > unsigned char address@hidden)y
> This sounds reasonably inconvenient for authors of modules, plus it's a
> pain to document. Why not just assume GMP instead? It's pretty unlikely
> authors would use anything else for bignums. This should simplify the
> code not only on the Emacs side but also on the module side; plus it
> should improve performance by avoiding roundtrips through mpz_export and
> mpz_import.

I considered using GMP. However, it has quite a few downsides:
- It would require making emacs-module.h dependent on GMP, even for
users that don't use big integers. Right now it only depends on
standard C, and I'd like to keep it that way.
- It's unclear how well GMP is supported in other languages. mpz_t is
a weird and unusual type, and other languages might not support it
well in their C interface.
- Other languages tend to have their own bigint support, so I don't
think the advantages of using GMP directly are that big.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]