Saturday, October 09, 2004

The trouble with Python

I like Python, really. And I regret that I don't have much time to learn it, and I regret that I've never actually written a program in it. But it's too slow.

I don't mind if a language is slow, really I don't. Not per se. There's lots of computing power in every computer today so it usually doesn't matter. The key word, though, is “usually”. Usually it doesn't matter, but sometimes it does. The trouble with Python is not that it's slow, but that it can't not be slow. It is always interpreted, and it always uses a dynamic type system. Even if you could compile it, the type system would always slow you down. Which is too bad because it has a nice syntax and many people say it's fun to use.

You can interface with C, of course (there may be problems with Stackless I hear, but they're being ironed out). And personally I've got lots of experience in C, but that's beside the point. I think a truly general-purpose language should be good for virtually any task, even those tasks that require really fast code. I don't want to switch to another language in the middle of development when I already like the one I'm using. Anyway, one place where speed still matters is small devices like PocketPCs and Palms and cell phones. And since these devices are becoming more and more important, it's important once again to have a language that can run code fast.

Still, Python might be the best general purpose language out there that is also well-known and popular. I hope I get a good excuse to use it someday.

No comments: