Why I love python.

Michael J. Fromberger Michael.J.Fromberger at Clothing.Dartmouth.EDU
Fri Aug 13 16:10:01 CEST 2004

In article <slrnchpf2s.7ld.npat at gray.efault.net>,
 Nick Patavalis <npat at efault.net> wrote:
> At this moment Python is an excelent *glue* language for stuff written
> in low-level laguages. It is also an exelent prototyping language. It
> has a long way to go before becomming a true "production" language (in
> the sense outlined above). Most of this way has to do with Python
> *implementations* and not with Python-the-Language. But it seems that
> there are some steps that must be taken by the language itself in
> order to open the road to efficient implementations.

Let me play the Devil's advocate for a moment here.  

Why is it important to write an entire program in a single language 
(e.g., Python), versus using a hybrid approach?  If you can use Python 
at all, that means your platform already has good support for a C 
compiler, so there is no reason not to use C extensions if you really 
need performance.

Now, perhaps you'll argue that C extensions are not as portable as 
Python ones.  And yet, portability failures usually arise from 
differences in how you access hardware (e.g., graphics cards, audio 
hardware, input devices) or operating system API's, and those 
differences are going to crop up in Python as well.  If you are going to 
have to write system-specific code anyway, and assuming you are very 
concerned about "high performance," you might as well just provide 
multiple C extensions to accommodate the difference, and let the Python 
glue code remain the same.

By this view, I would argue that Python is a much better "production" 
language than many other languages currently being used in that role.  
It is no harder to write extensions for Python than to write native 
methods for Java (and, I would argue, easier for several common cases).  
Furthermore, Python can be stripped down and imbedded without too much 
pain, so that the developer is not forced to maintain a single 
monolithic code-base for their entire application in Python, simply to 
take advantage of a few of its powerful features.

In short, I would argue that Python's ability to play nicely in a 
multipe-language development project is actually a sign of its maturity 
as a production tool.  More cool languages are killed by their lack of 
ability to interface nicely with other cool languages, than all other 
reasons combined.


Michael J. Fromberger             | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/  | Dartmouth College, Hanover, NH, USA

More information about the Python-list mailing list