|
|
|
|
|
by loup-vaillant
5815 days ago
|
|
Say you need both modularity and low level access in a given program. Can they be so entangled that you absolutely have to put both in the same language? No matter how I put it, I fail to see how C++ can be better than C + (Python or Lua or Haskell, with FFI). Is the concept of using 2 languages at the same time so scary? |
|
That's not always an option if you've performance and memory constrains.
We're using Python only for high level scripting purposes.
If you've a performance critical function, where few data goes in, long computation and few data out, then it's perfect to implement this function in C and have a python function calling it.
But if you've a lot of data, then that's not an option. You just can't copy all the data to C and then after computation back to python, it will kill the performance gained by the C function implementation.
But also if you're trying to do complex operations on your application object hierarchy, Python will kill your performance. Only compare the time for a member/property access in Python and C++.