Typing system vs. Java

Andy Freeman anamax at earthlink.net
Tue Aug 7 13:32:31 EDT 2001


Christopher Barber <cbarber at curl.com> wrote in message news:<psoitg1md4l.fsf at jekyll.curl.com>...
> anamax at earthlink.net (Andy Freeman) writes:
> > Only if you've already exhausted algorithm/architecture/infrastructure
> > improvements and "decrease run-time at any cost" really is the primary
> > consideration.
> 
> It could be pretty expensive to move all of your code to a faster language if
> you discover that Python is not good enough.  Sometimes you can write C
> extensions for the slow parts, but in some cases you will have to start over.

If experience is much of a guide, writing first in python and then
in C tends to be cheaper/faster than writing in C from the beginning.
Heck, writing in C then writing in C is often cheaper than writing in C.

BTW - I would like to see an application that doesn't have significant
hotspots.  I doubt that there are very many.

> Don't be silly.  Try to write a 3D game entirely in Python without using any
> extensions.  You won't stand a chance.  Once you have to resort to extensions,
> you aren't talking about Python anymore but C.

And, how many of us are writing 3D games?  And, what fraction of their
functionality demands C today?  In six months?  Since Python is being
used extensively for 3D games today....  (BTW - Why does a single C
extension make something a C program?  Does it matter whether that
C extension is "standard"?)

Besides, the compute-intensive part of 3D games has already migrated to
near-hardware.   There's still some mechanics/lighting that Python
can't quite do in real-time, but Moore's law will cure that fairly soon.
At that point, the only C "required" will be doing format conversions
(because python's internal representations are unlikely to match what
the display processor demands).

> applications, but it is ridiculous to say that there aren't a significant
> number of applications for which it does not have the required performance.

The only significant application is the one that you're working on.

However, if you think that you're forced to C for performance and the
application is big enough to take six or more months to write in C, you
might find that you're better off taking half that time off and then
writing in Python because Python will be faster then.

In a Moore's Law world, trading increased development time for increased
performance has generally been a loser.  That's how C (mostly) killed
assembler.  That's how relational databases won.  Java is trying to
ride the same trend.  Even when "performance is more important than
development time" has won in the short-term, it has lost in the long
term.

Today, most of us (outside the embedded world) write apps that are
disk-bound or wait for people, and that fraction is increasing.

-andy



More information about the Python-list mailing list