[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread rjf
... continued... Of course it can. Here is one of your 5000 lines of mpz_add's:     cpdef ModuleElement _iadd_(self, ModuleElement right):         # self and right are guaranteed to be Integers, self safe to mutate         mpz_add(self.value, self.value, (Integerright).value)        

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread William Stein
On Sun, Aug 16, 2009 at 10:54 PM, rjffate...@gmail.com wrote: I agree with you entirely, which is why I asked about the 5000 lines with mpz. One possible answer is, #...@#$%$, Python doesn't have macros. That is not why the Sage library uses the GMP C library interface in some places. The

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread William Stein
On Sun, Aug 16, 2009 at 11:18 PM, rjffate...@gmail.com wrote: Look, I agree that it would be a nice language feature. Even the C++ preprocessor doesn't have enough macro expansion for my liking, and C+ + is one of the languages used in Sage. This is definitely a nice feature in Lisp. But it

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Fredrik Johansson
On Sat, Aug 15, 2009 at 9:57 PM, Fredrik Johanssonfredrik.johans...@gmail.com wrote: On Sat, Aug 15, 2009 at 4:40 PM, Minh Nguyennguyenmi...@gmail.com wrote: Hi folks, I noticed the following thread from the Maxima mailing list. -- Regards Minh Van Nguyen -- Forwarded message

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Bill Hart
2009/8/17 William Stein wst...@gmail.com: On Sun, Aug 16, 2009 at 10:54 PM, rjffate...@gmail.com wrote: I agree with you entirely, which is why I asked about the 5000 lines with mpz. One possible answer is, #...@#$%$, Python doesn't have macros. That is not why the Sage library uses the

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread William Stein
On Mon, Aug 17, 2009 at 1:17 AM, Bill Hartgoodwillh...@googlemail.com wrote: Actually Python is often vastly slower than Lisp. It is very rarely faster. The point of python is most certainly not its speed. It is ease of use, through and through. The whole language was designed with that in

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Bill Hart
2009/8/17 William Stein wst...@gmail.com: On Mon, Aug 17, 2009 at 1:17 AM, Bill Hartgoodwillh...@googlemail.com wrote: Actually Python is often vastly slower than Lisp. It is very rarely faster. The point of python is most certainly not its speed. It is ease of use, through and through. The

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread William Stein
On Mon, Aug 17, 2009 at 2:10 AM, Bill Hartgoodwillh...@googlemail.com wrote: 2009/8/17 William Stein wst...@gmail.com: On Mon, Aug 17, 2009 at 1:17 AM, Bill Hartgoodwillh...@googlemail.com wrote: Actually Python is often vastly slower than Lisp. It is very rarely faster. The point of

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Juan Jose Garcia-Ripoll
On Mon, Aug 17, 2009 at 11:28 AM, William Steinwst...@gmail.com wrote: Ah, that makes sense. It never occurred to me to check if any of the lisp implementations actually used GMP or MPIR. Now I just recalled that you recently encouraged ECL to switch from GMP to MPIR. Did they do so? I recall

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Bill Hart
Well ECL uses mpz_add 11 times in 73783 lines of Lisp code *not* including system header files, which I removed, compared to 111 occurrences in Sage's 1.66M lines of Python code (to be honest I am not sure if it counted the Cython files or not, but what's another 300K lines between friends). Now

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Bill Hart
Hmm, wait a minute, there is a good chance there's a lot of duplicate files there, due to HG or something. Perhaps there's only 300K of python and cython lines of code. So maybe 111 occurrences is actually a bit high based on this (silly) metric. Bill. 2009/8/17 Bill Hart

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Juan Jose Garcia-Ripoll
On Mon, Aug 17, 2009 at 12:20 PM, Bill Hartgoodwillh...@googlemail.com wrote: So it seems Lisp is actually a bit mpz_add heavy. I'd write to the authors and complain about that. Sorry to sound rude, but I am afraid you have no idea what you are talking about. Common Lisp does not support

Re: [mpir-devel] Re: [sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread William Stein
On Mon, Aug 17, 2009 at 3:37 AM, Juan Jose Garcia-Ripolljuanjose.garciarip...@googlemail.com wrote: On Mon, Aug 17, 2009 at 12:20 PM, Bill Hartgoodwillh...@googlemail.com wrote: So it seems Lisp is actually a bit mpz_add heavy. I'd write to the authors and complain about that. Sorry to

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread Jason Grout
rjf wrote: Well, I don't know about there being no decent compiler; Sage has not chosen Lisps based on technical merit, and may have encountered ones without decent compilers. It would be a much more productive use of time to implement macros in Python. Of course that is being done.

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread rjf
People discussing the merits of languages based on statistical popularity should note how many newspapers publish astrology columns. The language shootouts are not entirely relevant, since the question here has to do with suitability of a language for implementation of a computer algebra

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread gsw
7. I have no problem with summer-of-code high school or college or ... students writing programs. Relying on this code as part of the core of a system is however not such a great plan. RJF I allowed myself to answer to this point (7.) on sage-flame. Cheers, Georg

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-17 Thread rjf
On Aug 17, 2:00 pm, gsw georgswe...@googlemail.com wrote: 7. I have no problem with summer-of-code high school or college or ... students writing programs. Relying on this code as part of the core of a system is however not such a great plan. RJF I allowed myself to answer to this

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread Bill Hart
On 15 Aug, 21:30, rjf fate...@gmail.com wrote: I am pleased to learn that deficiencies in gmpy are not inherited by Sage, and that MPIR,  equivalent functionally to GMP is accessible more directly. It doesn't seem that it should be a point of pride that there are 5000 lines in Sage that

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread rjf
On Aug 16, 3:30 pm, Bill Hart goodwillh...@googlemail.com wrote: ..snip... {RJF]  (mpfr::with-temps (/(- (* (- (* 2 i)1) x t1) (* (- i 1) t0)) i))) That's a very interesting example. Are you saying that Lisp automatically divines which MPFR functions to assign to those operators? no,

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread Bill Hart
On 17 Aug, 02:28, rjf fate...@gmail.com wrote: On Aug 16, 3:30 pm, Bill Hart goodwillh...@googlemail.com wrote: ..snip... {RJF]   (mpfr::with-temps (/(- (* (- (* 2 i)1) x t1) (* (- i 1) t0)) i))) That's a very interesting example. Are you saying that Lisp automatically divines

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread Bill Hart
I should point out that the vast majority of Sage files do not have mpz_add in them The below are merely the ones that do. Bill. On 17 Aug, 04:04, Bill Hart goodwillh...@googlemail.com wrote: Just to put this 5000 lines in context, here are counts of the number of occurrences of mpz_add in

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread Bill Hart
Just to put this 5000 lines in context, here are counts of the number of occurrences of mpz_add in all the Cython and Python files in Sage: /sage/modular/modsym/heilbronn.pyx:1 /sage/ext/multi_modular.pyx:2 /sage/combinat/expnums.pyx:1 /sage/modules/vector_integer_dense.pyx:2

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-16 Thread rjf
First of all, I am confused about Python and macros. If I read this posting from March, 2009, Python doesn't have macros. http://blog.pythonisito.com/2009/03/python-macros.html So maybe this guy is misinformed? ...snip... Right, but you could write a similar macro in python. {Scratches

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-15 Thread rjf
wow, I post one place and it comes out in two places... Here is an amplification about the comments on GMP and GMPY. From the perspective of Sage and python, I just took a look at the current gmpy. The documentation, which has not apparently been updated since 2003, says Early tests have

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-15 Thread William Stein
2009/8/15 rjf fate...@gmail.com: wow, I post one place and it comes out in two places... Here is an amplification about the comments on GMP and GMPY. From the perspective of Sage and python, I just took a look at the current gmpy. The documentation,  which has not apparently been updated

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-15 Thread Fredrik Johansson
On Sat, Aug 15, 2009 at 4:40 PM, Minh Nguyennguyenmi...@gmail.com wrote: Hi folks, I noticed the following thread from the Maxima mailing list. -- Regards Minh Van Nguyen -- Forwarded message -- From: Richard Fateman fate...@cs.berkeley.edu Date: Sun, Aug 16, 2009 at

[sage-devel] Re: Fwd: [Maxima] mpmath + sage + hypergeometric numerics

2009-08-15 Thread rjf
I am pleased to learn that deficiencies in gmpy are not inherited by Sage, and that MPIR, equivalent functionally to GMP is accessible more directly. It doesn't seem that it should be a point of pride that there are 5000 lines in Sage that include mpz_ ... (e.g. mpz_addmul(a,b,c) computes