What are your favorite and least favorite things about Fortran?

(Sorry for revitalizing this old post)

Favorite:

  1. Native support for matrices (I mean automatic arrays in particular; allocatable arrays are OK but automatic arrays are closer to mathematics).

  2. Intrinsic support for matrix/vector operations: matrix addition/multiplication, transpose, slicing, broadcasting, …; without such intrinsic functionalities, a language should not be called a “formula translator”.

  3. High performance.

Least favorite (sorry, I have more than three):

  1. The robustness and performance of automatic arrays and intrinsic matrix/vector operations can still be improved (largely).
    Speaking about robustness, automatic arrays and intrinsic matrix/vector operations can lead to stack overflows (segfaults) under the default settings of some major compilers; this kind of major failure seems to be weirdly permitted by the Fortran community (e.g., see this 13-year old report to Intel and the latest experiment reproducing the same failure); this is unimaginable in other popular languages with the same functionalities, e.g., MATLAB/Python/R/Julia, unless you are encountering a bug that has to be fixed.
    As for performance, the intrinsic matrix/vector operations in Fortran normally cannot achieve the same performance as the intrinsic matrix/vector operations in MATLAB under default settings unless you are capable enough to make your compiler link to the correct library, which may be nontrivial as discussed in another post on this discourse. I know, MATLAB achieves high performance only because of the Fortran code underneath, but it is difficult to understand why Fortran itself does not optimize its intrinsic matrix/vector operations (under the default settings, without the need for particular options) in the same way.
    As mentioned in many posts above, the native support for matrices (arrays) and matrix/vector operations is one of the core strengths of Fortran. I do not see any reason why the community should be indifferent to its robustness and performance in this regard.

  2. Lack of support for functions with multiple returns. True, we have subroutines that can return arbitrarily many results, but functions are less error-prone and often more intuitive.

  3. Lack of interactivity. Fortunately, LFortran @certik is solving this problem.

  4. Lack of support for logical indexing of arrays, which exists in all other popular modern languages used in scientific computing, namely MATLAB/Python/R/Julia.

  5. Implicit mapping.

2 Likes