4 ms·
As a computational scientist who knows C, Fortran, IDL, MATLAB, Mathematica, Pascal, Python, and R for about two decades, I can tell you that the unique advanta
by TheRealKing 7y ago
As a computational scientist who knows C, Fortran, IDL, MATLAB, Mathematica, Pascal, Python, and R for about two decades, I can tell you that the unique advantage of (modern) Fortran (2008/2018) over any other languages mentioned here is in its great flexibility and high-performance for numerical computing and basically any mathematical problem. It has a coding and syntax flexibility comparable to MATLAB and Python, but the runtime speed of C, and in many cases, beyond C. It is the only high-performance programming language that has native built-in mechanism for one-sided parallel programming on shared and distributed architectures that can scale your code from your laptop to the largest supercomputers in the world (Coarray Fortran parallelism). Checkout the OpenCorrays software on GitHub and Intel's amazing Coarray-enabled Fortran compiler. Also, Fortran along with C, are the only two languages for which the MPI standard is written. OpenMP parallelism also has its roots in the Fortran language. Nvidia is also working on a new F18 compiler for Fortran which enables GPU parallel computing via the same Coarray Fortran syntax and rules. One parallel programming API for all architectures and platforms. No programming language has this capability that I am aware of.
Typically, simulations that I run in MATLAB, Python or R, take 100 to 500 times longer than the equivalents that I write in Fortran. I am sure you can achieve a similar performance with C as well. But the development cost in C is much higher for numerical computing than in Fortran, given Fortran's native array-based syntax, parallelism features, optimization hints to the compiler, and the new high-level string and memory manipulation tools that it has.
That said, every language has its usage and place in the world of programming. In my case, all of the post-processing analyses of my Fortran/C simulation results are done in either Python or MATLAB, and sometimes in R. They complement each other rather than being rivals to each other.