unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bignum support + calc + GNU Emacs
@ 2007-05-20 19:52 Jose E. Marchesi
  2007-05-21 13:24 ` Richard Stallman
  2007-05-21 13:32 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2007-05-20 19:52 UTC (permalink / raw)
  To: emacs-devel


Hi all.

I am in the process of writing uuid.el, a implementation of the ITU
X.667 standard for the generation of Universal Unique Identifiers. I
need that support for the AddressBook[1].

In order to generate the uuids the program should manipulate 60-bit
unsigned integers. The question is, for a program/library supposed to
work in GNU Emacs, would it be considered good practice to use
(require) calc's lisp implementation of bignums, considering uuid.el
is intended to be a quite generic library?

On the other hand, i made a search in the emacs-devel archive for
discussion regarding bignum support, without results.

I think would be quite good to have some "standarized" way to use
bignum/bigfloats in Emacs. I like the calc way to manage the issue in
pure lisp, but to make the garbage collector to work with libgmp would
be great too (i think XEmacs already has support for libgmp).

Any though?


[1] http://www.emacswiki.org/cgi-bin/wiki/AddressBook 

-- 
Jose E. Marchesi    <jemarch@gnu.org>
                    <jemarch@es.gnu.org>

GNU Project         http://www.gnu.org
GNU Spain           http://es.gnu.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bignum support + calc + GNU Emacs
  2007-05-20 19:52 bignum support + calc + GNU Emacs Jose E. Marchesi
@ 2007-05-21 13:24 ` Richard Stallman
  2007-05-21 13:57   ` David Kastrup
  2007-05-21 17:51   ` Jose E. Marchesi
  2007-05-21 13:32 ` Stefan Monnier
  1 sibling, 2 replies; 6+ messages in thread
From: Richard Stallman @ 2007-05-21 13:24 UTC (permalink / raw)
  To: Jose E. Marchesi; +Cc: emacs-devel

If we really want bignums, we may as well do it through libgmp.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bignum support + calc + GNU Emacs
  2007-05-20 19:52 bignum support + calc + GNU Emacs Jose E. Marchesi
  2007-05-21 13:24 ` Richard Stallman
@ 2007-05-21 13:32 ` Stefan Monnier
  2007-05-21 17:57   ` Jose E. Marchesi
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2007-05-21 13:32 UTC (permalink / raw)
  To: Jose E. Marchesi; +Cc: emacs-devel

> In order to generate the uuids the program should manipulate 60-bit
> unsigned integers. The question is, for a program/library supposed to
> work in GNU Emacs, would it be considered good practice to use
> (require) calc's lisp implementation of bignums, considering uuid.el
> is intended to be a quite generic library?

It sounds OK to me.

> I think would be quite good to have some "standarized" way to use
> bignum/bigfloats in Emacs. I like the calc way to manage the issue in
> pure lisp, but to make the garbage collector to work with libgmp would
> be great too (i think XEmacs already has support for libgmp).

Gerd Moellman had written some preliminary code to add libgmp support to
Emacs, but it didn't generate much discussion or interest.
You can take a look at the "gerd_big" branch in CVS (or is it the
"gerd_int" branch, maybe?).


        Stefan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bignum support + calc + GNU Emacs
  2007-05-21 13:24 ` Richard Stallman
@ 2007-05-21 13:57   ` David Kastrup
  2007-05-21 17:51   ` Jose E. Marchesi
  1 sibling, 0 replies; 6+ messages in thread
From: David Kastrup @ 2007-05-21 13:57 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, Jose E. Marchesi

Richard Stallman <rms@gnu.org> writes:

> If we really want bignums, we may as well do it through libgmp.

Agreed.  It seems however like overkill to require this for uuid.
Requiring some part of calc, in contrast, seems to be at a reasonable
level of pain.  It would be nice to have calc use bignums when they
are compiled in, but I don't know whether that is realistic: calc has
not been updated to make use of floating point where available (that
was supposed to be the point of calc 3 which presumably was already
running in prototype state for Dave Gillespie at one point of time,
probably 12 years ago.  All attempts to contact him about this have,
however, failed).  It does not even make use of the available range
for integers (which has grown since calc's inception).

Or even menus.  It would be a worthwhile task to bring calc up to the
features provided by Emacs 19, so I am somewhat sceptical that it will
help much if we set ourselves calc goals based on prospective Emacs 23
features.

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bignum support + calc + GNU Emacs
  2007-05-21 13:24 ` Richard Stallman
  2007-05-21 13:57   ` David Kastrup
@ 2007-05-21 17:51   ` Jose E. Marchesi
  1 sibling, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2007-05-21 17:51 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel


    If we really want bignums, we may as well do it through libgmp.
    
I shall take a look to the branch Stefan pointed out. I am a bit
curious about how to interface the garbage collector to a library like
libgmp.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bignum support + calc + GNU Emacs
  2007-05-21 13:32 ` Stefan Monnier
@ 2007-05-21 17:57   ` Jose E. Marchesi
  0 siblings, 0 replies; 6+ messages in thread
From: Jose E. Marchesi @ 2007-05-21 17:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel


    > In order to generate the uuids the program should manipulate 60-bit
    > unsigned integers. The question is, for a program/library supposed to
    > work in GNU Emacs, would it be considered good practice to use
    > (require) calc's lisp implementation of bignums, considering uuid.el
    > is intended to be a quite generic library?
    
    It sounds OK to me.

Ok. The `math-*' interface implemented by calc is enough to fit
uuid.el needs.
    
    > I think would be quite good to have some "standarized" way to use
    > bignum/bigfloats in Emacs. I like the calc way to manage the issue in
    > pure lisp, but to make the garbage collector to work with libgmp would
    > be great too (i think XEmacs already has support for libgmp).
    
    Gerd Moellman had written some preliminary code to add libgmp support to
    Emacs, but it didn't generate much discussion or interest.
    You can take a look at the "gerd_big" branch in CVS (or is it the
    "gerd_int" branch, maybe?).

Thanks for the info! I am downloading the branch right now (it seems
to be `gerd_big', by the way :) )

-- 
Jose E. Marchesi    <jemarch@gnu.org>
                    <jemarch@es.gnu.org>

GNU Project         http://www.gnu.org
GNU Spain           http://es.gnu.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-21 17:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-20 19:52 bignum support + calc + GNU Emacs Jose E. Marchesi
2007-05-21 13:24 ` Richard Stallman
2007-05-21 13:57   ` David Kastrup
2007-05-21 17:51   ` Jose E. Marchesi
2007-05-21 13:32 ` Stefan Monnier
2007-05-21 17:57   ` Jose E. Marchesi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).