   Combining C++ and Python
  I'm planning to combine C++ and Python in my next project (C++ for data-intensive, low-level stuff [runtime speed], and Python for the higher level, game-logic stuff [development speed]).Haven't combined the two languages before, and was wondering what people with experience would advise:1) Final game is in Python, accessing the C++ portions as Python extensions...*** OR ***2) Final game is in C++, embedding the Python InterpreterAny thoughts?   
  My idea: Your game and engine should be C++, with the Python VM either as a linked library (dynamic or static). Your game logic code should be in Python, with interfaces to your binary.You could also look at GameMonkey, Lua, or Angelscript (amongst others) for alternatives to Python.GameMonkey is cool but very immature and without 64-bit support.AngelScript is very much like C++, and is insanely easy to link up and bind. It is also the slowest as far as benchmarks I've seen have shown.Lua is not like C++ at all, very different. It is extremely fast and extremely used/accepted in the industry.Don't know much about Python, save that one of my coder buddies swears by it.   ;  Using C and C++ within python is very easy to do using the built in ctypes module. This is how I would recommend using python and compiled C++. Embedding python into a C/C++ is more difficult and dous not necessarily improve performance in a significant way.Keep in mind though that ctypes does not support C++'s caalling conventions, so you'll have to provide an interface to your C++ using a compatible convention.   ;  Many choices here, but here are a few...1. Embedding python in C++: See boost::python, makes it fairly trivial. Just link to the python library.2. Embedding C++ in python: again, see boost::python. You can also use ctypes, but it's not nearly as nice as wrapping things up in a python interface through boost.   ;  It doesn't really matter. Embedding python makes it slightly easier to debug C++ and extending python makes it slightly easier to debug python code, but switching between the two is pretty easy.   ;  The mainstream idea is still binary to virtual machine inheritance, and not vice versa. You can limit the amount of cross-system calls moreso with that, as you are likely to be in the engine more than in the game logic.Plus, C++ is prettier.   ;  Im putting a vote in for Boost.Pythonadditionally, look into SWIG which might suite you better, and allows for a bit more flexibility in interface language choice.   ;  If the C++ part is a Python module, that means that the program entry point is in Python. This either means that the user needs to already have Python installed, or you distribute Python along with your module which is... kinda gross. I'm for embedding Python in a C++ program.With that said, I have to put in a good word for Lua. For one thing, it's designed from the ground up to be embedded. And it's really a beautiful little language. The only thing you can say about it is that object-orientation, at least in the traditional sense, is a bit tricky. I was going to embed Python at first, but I've changed my plan to Lua.   ;  Hmm, glanced at Lua, definitely seems to be a good possibility as well.  I'll give it a through look-into before making my decision.   ;Quote:Original post by theOcelotIf the C++ part is a Python module, that means that the program entry point is in Python. This either means that the user needs to already have Python installed, or you distribute Python along with your module which is... kinda gross. I'm for embedding Python in a C++ program. py2exe 