On 11/20/07, Ondrej Certik <[EMAIL PROTECTED]> wrote:

> I think the right way to write programs is to start in Python, and
> later (when you know how) rewrite some parts to C, or C++ or
> Cython to gain the maximum possible speed.

If the program is the end-goal, that makes sense.

If the program is itself a teaching tool, then you need to remember
that anyone not already using it missed the history -- if you switch
to optimized (but less clear) code, then they miss out of the
easy-to-understand stage.

Within CPython itself, there is sometimes a tension between keeping
library modules written in python, vs moving them to C for speed.  The
closest there is to a standard answer (which is still evolving) is:

module.py -- the normative version.  This should be complete, which
also helps alternative implementations, such as Jython and the various
.net versions.  [Note that in practice, it often isn't complete, but
it should be, and the situation certainly shouldn't degrade.  One
Google Summer of Code (Alexandre Vassalotti?) project helped with
this.]

_module -- some C speedups.  Users should not import this directly,
but module should import it conditionally.

The speedups should be imported by default, but it should be fairly
simple to bypass them -- and both versions should be tested by the
automated regression tests.  (There was at least talk of enhancing
unittest to support this better.)

-jJ

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to