Scipy is replacing Fortran with C

This has been discussed at length also on Fortran Discourse:

Since it is a long thread, I will link to a direct answer from one of the SciPy maintainers, why preserving the existing fixed-form Fortran code is non-desirable: The difficulties of using Fortran in SciPy - #54 by ev-br

I can certainly agree the style of these existing legacy codes can be hard to comprehend (even for Fortran programmers). There are other issues too like static variables (save), API’s relying on named user procedures instead of procedure arguments (callbacks), and a bunch of wrapper idiosyncrasies which get in the way of sane software engineering.

The next issue SciPy faced is due to build woes, such as:

  • lack of native Fortran compiler on Windows (if I remember correctly using gfortran via Cygwin or MinGW is problematic, because of incompatibilities in the underlying C libraries when the Python interpreter is compiled with MVSC)
  • issues on MacOS (and more recently also Windows) with Aarch64 processors, where Fortran compilers still aren’t as mature (although it is getting better)

A good write-up can be found here: The 'eu' in eucatastrophe – Why SciPy builds for Python 3.12 on Windows are a minor miracle | Labs


There is also a related thread at the Scientific Python Discourse, discussing new Fortran libraries/components:

1 Like