"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?"
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++.
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++.