I’d rather do math in a general-purpose language than try to do general-purpose programming in a math language.
Mathematical software is never purely mathematical. The math has to connect to something, and that’s where most of the programming effort may go.
If you’re responsible for the math and for the larger system it’s embedded in, you have three options.
- Write the math in an application programming language.
- Do application programming in a mathematical language.
- Use different languages for the math and the larger system.
My preferred option is #1. My second choice is #3. My last choice, by far, is #2.
Application languages are typically better for math than mathematical languages are for applications. Application languages also have a larger user base, and hence better documentation and tools.
Mixing two languages works well in a team that has someone specialized in the math language, someone specialized in the application language, and someone fluent in plumbing the two languages together. If you have be all three people, you might wonder whether you could do everything in one language.
For daily tips on Python and scientific computing, follow @SciPyTip on Twitter.