A story about Python... sort of

Russell Reagan rreagan at attbi.com
Sun Jul 6 22:02:06 EDT 2003


"Dave Brueck" <dave at pythonapocrypha.com> wrote

> Actually, games are a particularly good example to illustrate the point:
> 1)...
> 2)...
> 3)...
> 4)...

Good points.


> There came a time when it was no longer economically viable to develop an
> entire game in assembly, and IMO we've *already* passed the point where
it's
> no longer economically viable to develop most games entirely in C++ - the
> time to market is too long, it's too expensive to add new features,
> recovering from early incorrect decisions is too costly, etc. Games are
> moving to higher-level languages as much as they can because it's a
> competitive advantage to do so.

After thinking about it I tend to agree. I'm a little partial to C/C++
because I develop (as a hobby) a chess playing program, and I like tinkering
with it to see how fast it can go, and finding clever ways of doing things.
A chess program is different from a 3D game in that with a 3D game, you can
stop at some point and say, "ok, this is fast enough." There is little point
in making the game run at 1000 frames per second if no human eye can see
more than 60 (or whatever the number is). With a chess program, you can
never really say, "ok, this is fast enough." Deep Blue peaked out at around
one billion positions per second with a very sophisticated evaluation of
each position, and it was still only on par with the best humans in the
world. At some point a machine will be able to look ahead from the opening
to the end of the game and "solve" chess, and then we can say, "ok, that's
fast enough." But until that happens in a few thousand years (maybe), there
is no such thing as "fast enough". The same could be said for cryptography
software, finding larger prime numbers, probably medical research, and other
similar domains where "fast enough" doesn't exist. Granted, these are few,
but some, like medical research and cryptography, are very important.

Anyway, I know of one chess program written in python, and it is dreadfully
slow compared to *any* program written in C/C++ (that I've seen anyway). I
have just recently started learning python, and I'm interested in learning
about the python/c options that are available, and seeing if I can write a
chess engine in python/c that can compare to those written in C/C++. I
really like python so far, but I'm not sure how well it is suited for a
chess program. The things that make a chess program fast aren't really
python's strengths, but hopefully I'm being pessimistic due to my lack of
python/c knowledge. I just need to learn the language more so I can start
playing with python/c. Hopefully I won't end up writing the entire thing in
C and creating a python module like this:

import chess
chess.run_program_in_c
print "Thanks for playing! Bye!"

;-)






More information about the Python-list mailing list