A faster Python?, Python compiler, Dylan,...
Terry Reedy
tejarex at yahoo.com
Wed Apr 3 09:29:49 EST 2002
"Jan Kybic" <kybic at ieee.org> wrote in message
news:lbhpu1hhwnb.fsf_-_ at xihu.inria.fr...
> On the other hand, all the calculation that you cannot express using
> high-level primitives (using matrices, vectors,...) and has to be
> performed with loops element by element, is painfully slow. Equally
> slow in Python, as in IDL, Matlab,... It is so slow that it is
> unusable, it is very difficult to develop an algorithm if it takes
> days to process any reasonably sized input. My solution is to
rewrite
> the critical part of the code in C/C++, I did this for Matlab,
> Python+Numeric, as well as IDL, but this is awkward - it forces you
to
> work simultaneously with two languages and to deal besides the
algorithm
> itself with a lot of implementation and interface details.
>
> In fact, it has become such a burden, that I am seriously
considering
> switching to another language. The only problem is that I still have
> not found anything high-level, elegant, fast, and free at the same
time.
>
> It would be so much easier if I could just compile parts of the
Python
> code into the machine code. This would enable to use Python both for
> the prototyping and for the production code.
I imagine that it should be possible to pretty easily translate a
very restricted, special purpose, subset of Python into C for
compilation. A module of strictly numeric functions is the most
obvious example. Ie, assume all vars except loop indexed are floats
and arrays thereof. I do not know what has been done in this
direction, though.
I believe there is a recently announced program (weave?) for embedding
C within Python.
Terry J. Reedy
More information about the Python-list
mailing list