How about C++

The BGE is written in C++ so learning C++ would be worth it if he decided to become a Blender developer developing the BGE.

Do you expect to have Blender re-written in Python or something? Someone actually suggested that along with possibly re-writing Blender in Java on the 2.5 mailing list and he got flamed as he continued pushing it until Ton put him on moderation.

For most stuff you’d want to do in the BGE, Python is the natural choice. It’s possible to write quite efficient and readable scripts. (Readable = easily modified, saving development time).

If you have the C++ chops, your energy would probably be better spent in an engine that’s designed for it - like Panda or Ogre. Or better yet: Work on features that extend the BGE, but in a way that’s general enough to be used by everyone. Or, make a Python utility module for the most difficult / intensive tasks. Again, this will be useful for others.

In the future, yes. It is possible some other program takes over too, but the only direction in the future is towards clearer and more educable code. It’s the only way to survive.

if python some day becomes as powerful and fast as c++ is today without getting it’s syntax desfigured, i’d go for it (note, that may mean that CPUs would have to run python natively)

still…
c++ is what we have now and we have to deal with it, is not that bad as programmer humor says (and a lot of people take it seriously, to my astonishment). But the idea of prototyping with an interpreted language first and then translating it to a faster language like C++ is, to me, the best thing to do. could be compared to making a scale building with blocks and then make the real one with the real materials.

Partially it is allready, because the classical Python is implemented with C.

And there is no reason why Python should be slower than C. It is possible to construct a compiler for Python too. The same principles with abstract syntax trees and compiler theories count for Python as they count for C.

The only real choise is for us programmers: Do we prefer a language with clean syntax or do we prefer a language with not so clean syntax.

Since we’re talking about python performance, I feel compelled to mention psyco as a fairly popular tool used to optimize python programs.

I wondered about that for some time. Although, I suspect that there are some aspects of python which ultimately require an interpreter. (can anyone confirm/refute this?)

I mean, if it was just a syntax issue, I think python syntax would have been implemented much, much earlier, and the entire language would have been used to compete head-on with C/++ back in the early days.

I think the interpreter is only for the sake of “Write Once, Run Everywhere”.Nothing a good dinamic or JIT compiler cannot fix, IMO. Also, Devs should look into the vectorizing of Python code, i know it’s been in research for some time for Java.

yeah, too bad psyco only works in x86_32, and yes there are some things only an interpreter can do without a lot of memory overhead, namely allow python’s type flexibility. psyco optimizes creating several versions of the functions based on code analysis, with good performance in most of the cases, but gets a pretty big memory footprint if you make heavy use of dynamic types.

Also, python’s syntax, although very nice, is not the holy grail, things like having (sometimes unnoticeable) whitespace changes modify the program behavior and lack of a ternary operator annoys me sometimes. So yeah, it’s not a syntax issue.

I figured as much. Thanks for the confirmation.

Also, python’s syntax, although very nice, is not the holy grail, things like having (sometimes unnoticeable) whitespace changes modify the program behavior and lack of a ternary operator annoys me sometimes. So yeah, it’s not a syntax issue.
I agree with the comment about whitespace, but for the ternary shortcut:


blah = 1 if 1==1 else 0
print blah # 1

This feature was made available in python 2.5, and if you ask me, it’s far more intuitive than this crap:


int blah = (1==1) ? 1 : 0;

Although, I guess that it’s ultimately a matter of personal taste -> Things like “if” and “else” are too obvious; some people just feel smarter when typing question marks. :smiley:

O_O; didn’t know that… last time i checked the ternary shortcut PEP appeared as rejected…maybe i read it wrong shamethanks for the tip (the syntax is different and nicer, to me it would still count as ternary operator, can be wrapped in parentheses :D)