Prototype in Python, Was: A faster Python?, Python compiler, Dylan,...

Jan Kybic kybic at ieee.org
Thu Apr 4 04:43:06 EST 2002


> your experience gained before tell you that Python slows down
> remarkably), wouldn't it be wise to implement the function in C or C++
> from the start on?

If you knew from the beginning what is to be implemented, of course.
But in real word (especially in the research world), you do not know
what is going to work. You try something based on your preliminary
analysis and experience and it does not quite give you the result you
wanted. So you keep tweaking the algorithm (and implementation) little
by little, until you are satisfied. For this exploratory programming,
Python is perfect. You can of course write it directly in C/C++ but if
the edit/compile/run cycle takes 30s or even more for templated C++
libraries, you are much less productive. Moreover, you write much more
in C than in Python.  Once you are satisfied, you want your algorithm
to run fast. So you rewrite everything into C/C++, having the Python
implementation as a reference. Not difficult, just takes time.

> But you should take into account that Python handles C interfaces very
> well. I am not sure how you just use your Python; whether you use Python
> only in combination with Numeric and not with a
> plotting/image-processing library. I say this in the light of your

I am using many Python extensions - PIL for images, Gnuplot for
plotting, VTK for 3D graphics, ... and I am very satisfied. That's why
I would prefer to stick to Python if I can, it makes a perfect glue
language.

J.

-- 
-------------------------------------------------------------------------
Jan Kybic <kybic at ieee.org>      Robotvis, INRIA, Sophia-Antipolis, France
       or <Jan.Kybic at sophia.inria.fr>,tel. work +33 492 38 7589, fax 7845
                    http://www-sop.inria.fr/robotvis/personnel/Jan.Kybic/



More information about the Python-list mailing list