C++ or Python for an Extensive Math Program?

c++, math, python

Solution

I guess it is safe to say that C++ is faster. Simply because it is a compiled language which means that only your code is running, not an interpreter as with python.

It is possible to write very fast code with python and very slow code with C++ though. So you have to program wisely in any language!

Another advantage is that C++ is type safe, which will help you to program what you actually want.

A disadvantage in some situations is that C++ is type safe, which will result in a design overhead. You have to think (maybe long and hard) about function and class interfaces, for instance.

I like python for many reasons. So don't understand this a plea against python.

Problem

I'm debating whether to use C++ or Python for a largely math-based program. Both have great math libraries, but which language is generally faster for complex math?

Original source