Could Python supplant Java?
James J. Besemer
jb at cascade-sys.com
Fri Aug 23 07:52:09 EDT 2002
Daniel Berlin wrote:
> > > 3. Tell me how even this small example program could be made 10X better
> > > than it's C++ equivalant:
> > >
> > > http://www.cascade-sys.com/~jb/Pythonetics//glob/
> > What??? After all the talk of 100K+ programs you cite a 300 line
> > C++ program?? ;-)
> And one written poorly, to boot.
> Not algorithmically, but in that it obviously should be using
> numeric python, since it's completely compute intensive.
I agree numerics would be more suitable. At the time I was interested in comparing the base
speeds of the two languages. I almost did a third version but lost interest in the project.
[Actually, IIRC, I tried downloading and installing Numerics, ran into some problems and gave up.]
Then too, I'm sure there are some C++ vector and image processing libraries that would have
collapsed my C++ code. To compare apples and apples I wanted a small app written from scratch in
Too, from a programmer productivity standpoint, I would think we'd all agree that having to resort
to Numerics is a slight negative. Would be more fair to count it as part of Python if it were
included in the standard distribution.
> Numeric python would help that, actually, since rather than your
> (I'm doing this off the cuff).
That's a good point and would save a few lines, eliminating the for loops in a few places.
Before your post I was expecting Numerics actually would make the code longer.
> It would be a *whole bunch* faster, too (orders of magnitude).
I'm especially curious to see how close it would come to the C++.
> I should point out that I can't get the C++ version to work right on my
> Linux box, either with Intel's compiler, or g++ (after taking out the
> pointless stdafx.h include, etc).
Hmmm.... never tried it on Linux. Dunno why it would be different.
I'll look into it.
Thanks for the info.
James J. Besemer 503-280-0838 voice
http://cascade-sys.com 503-280-0375 fax
mailto:jb at cascade-sys.com
More information about the Python-list