I've been using Ruby to write scripts for research, but I want to get into some heavier stuff that Ruby is just too slow for. I noticed there are a few things written in C and C++, but there is an oddly large proportion of software used in computational chemistry that is written in FORTRAN (in which I have zero experience.)

Why is FORTRAN used in computational chemistry? From what I understand, FORTRAN is kind of on the ancient side (“punchcard” old.) I was a bit shocked to find fairly recently written tutorials for FORTRAN.

Is it a sort of, "this is how we've always done it," thing or is there an efficiency aspect to FORTRAN I'm overlooking?

Note: I may have FORTRAN confused with later programming languages with similar names.

I don't think that's really true anymore.

Some Fortran use is historical (i.e., early codes were developed in FORTRAN because that was the best programming language for number crunching in the 70s and 80s). Heck, the name stands for "formula translation."

Some Fortran use is because of performance. The language was designed to be:


  especially suited to numeric computation and scientific computing.


Many times, I find chemistry coders sticking to Fortran because they know it and have existing highly optimized numeric code-bases.

I think the performance side isn't necessarily true anymore when using modern, highly optimizing C and C++ compilers.

I write a lot of code in C and C++ for performance and glue a lot of things with Python. I know some quantum programs are written exclusively or primarily in C++. Here are a few open source examples:


Psi4 - Written in C++ and Python
MPQC - Written in C++
LibInt - Written in C++ for efficient quantum integrals.
LibXC - Written in C with Fortran "bindings" for DFT exchange-correlation functionals


This is my opinion, but my recommendation for faster performance in chemistry would be Python with some C or C++ mixed in.

I find I'm more efficient coding in Python, partly because of the language, partly because of the many packages, partly since I don't have to compile, and that's all important.

Also, you can run Python scripts and functions in parallel, on the GPU, and even compile them, e.g. with Numba. As I said, if I think performance is crucial, I'll write pieces in C or usually C++ and link to Python as needed.
