Fortran: Array Language (video)

Array Language — a very precise and good name.

I do believe that one of the core strengths of Fortran is its native support for matrices and matrix/vector operations . This strength is super important and advantageous for a computing-oriented language, because most numerical algorithms are essentially a sequence of matrix/vector operations.

However, unfortunately, the Fortran community seems to be indifferent to the performance of Fortran’s intrinsic matrix/vector operations and even their occasional failures under default compiler settings. This is bizarre. See the following for example.

It seems quite “fashionable” in Fortran to code in loops instead of matrix/vector operations, while other computing-oriented languages like MATLAB/Python are all promoting the latter. Surely, this is partially because these scripting languages are inefficient with loops, but the good news is that their matrix/vector operations are as efficient as Fortran loops (thanks to the underlying C / Fortran libraries). The question is, why Fortran couldn’t / shouldn’t do the same? It would make the code much more understandable, maintainable, and expressive, and make the language much more accessible and usable to common users.

PRIMA uses matrix/vector operations as much as possible. No loop appears unless it is the only solution. When proposing to integrate PRIMA to SciPy, a comment I received from the SciPy community about the source code of PRIMA was as follows.

The syntax is clear, it uses vectorized assignments and Python-style (“modern”) slices when passing subarrays to a subroutine and so on

I am glad that my choice and effort are appreciated.