Hi,

On Wed, Feb 25, 2015 at 06:55:11PM +0100, Jeroen Demeyer wrote:
> Hello,
> 
> Should there be code in Sage which is extremely slow and for
> educational purposes only? I am talking about eratosthenes() which
> is just a very slow alternative to prime_range().
> 
> I would just remove that code, but maybe people have other opinions...

An issue is that names of functions/methods are usually about /what/ is
being done, not /how/, hence i am in favor to deprecate eratosthenes()
function and move the code as an 'algorithm' option of prime_range(). It
should be noticed that the other algorithms depend on pari, hence having
at least one self-contained implementation could be of some help, e.g.
for consistency testing (and hypothetically for far-future
modularization).

Recording such self-contained implementations is not only interesting for
educational purpose (this is sometimes frustrating to do function?? and
only see some calls to an external lib whose source code is not easily
available from Sage), but also in a context such as
http://wiki.sagemath.org/GSoC/2015#Generic_Dispatcher

I remember a discussion with Luca at Orsay during preparation of H2020
stuff, about using Sage as a research tool, where being able to tell Sage
"i want to rely only on such libs" makes sense. So, having a way to record
which lib is called in a dispatcher (in particular when "no lib" is
required) is pretty interesting, in particular about reproductibility
concerns.

Further (and less directly related), i would have proposed to move most
*_prime or prime_* functions from the global namespace to methods of the
Primes() class (e.g. primes_first_n() vs Primes().__getitem__() or
is_prime() vs Primes().__contains__() and so on). This is indeed easier to
find primes-related methods, for example, how can i discover the existence
of the next_prime() function from the tab completion ?

Ciao,
Thierry



> Jeroen.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to