OOo is written in, I believe, Java and GIMP is C? GTK is C, QT is C++ if memory serves. However both implement Python as a scripting language.
More telling, however, is that EVE-Online is written in Python.
The position of the Python community has always been that it is better to prototype or primarily code in Python, identify bottlenecks and if needed drop down to C to speed up those portions. This approach gives you the rapid development of Python with the speed of C in the areas where it is really needed.
Warning: Any code examples I write are probably untested and contain bugs. Do not execute directly. Look for intent, not accuracy, please!
L.A.G. - Jobs Dissembles - 2010/4/29
Well, it feels like Java sometimes.
Warning: Any code examples I write are probably untested and contain bugs. Do not execute directly. Look for intent, not accuracy, please!
L.A.G. - Jobs Dissembles - 2010/4/29
You still wouldn't be able to have enough money to hire people to invalidate the fact that it refutes the notion C++ is the only language in which to program games, amen?
But you're right. If only someone else would develop a game in Python *cough*FretsonFire*cough* or used Python extensively *cough*Vampires: Bloodlines*cough*hack*Tabula Rasa*wheeze* we could let EVE Online off the hook a tad, right?
Last edited by Greyed; December 15th, 2008 at 10:52 AM. Reason: Added a few examples.
Warning: Any code examples I write are probably untested and contain bugs. Do not execute directly. Look for intent, not accuracy, please!
L.A.G. - Jobs Dissembles - 2010/4/29
I do not know Python, but I have had this type of discussion many times before, only for other languages.
When looking at speed you have to look at two things: Speed of development vs Speed of execution.
(Generalisation)c++ will run faster than Python in most cases. But Python will develop faster than c++. (Going by all the posts of how easy a language it is to pick up and use)
So lets say you want to write a simple calculator application. And lets assume that Python takes you 1 hour to develop said application. c++ takes you 2 hours. Now c++ calculates your sums 1/10th of a second faster.
That means that you will have to make 36000 calculations on your calculator before you are losing time. Meaning you can almost do 100 calculations a day for a whole year before you have lost the 1 hour you gained by using Python instead of c++
This is just a (very) simple (and generalised) example to illustrate the basics of speed and programming.
Well, it's a good poster child because it counters several common misconceptions people have about Python. For instance, people think CPython IS Python, but really Python is a language, and CPython is just the most popular implementation (there's cpython/jython/ironpython/stackless python...)
But, as far as performance in Python goes... If you've got some code where you're profiled it, exhausted all chance of clean algorithmic optimization, and the thing still wont perform fast enough... Just write that tiny chunk in a compiled language and import it into Python. Writing a module in C is just as easy as compiling a DLL (any shared library can be FFI-loaded with the ctypes module and painlessly wrapped in Python objects for convenience). You can also take the PyRex and cython approach that find a sort of middle grounds between C and Python to make writing fast modules easier. And this, of course, is still just CPython, IronPython can leverage .NET libraries, Jython can leverage Java libraries...
Bookmarks