Fortran 2023

The release of the Fortran 2023 standard prompts renewed attention to a language still central to high‑performance computing in fields like weather prediction, climate modeling, CFD, and physics. Commenters highlight Fortran’s strengths—especially its array semantics, strict aliasing rules, and mature compilers—which make it easier to write fast numerical code than in C/C++ or Python+NumPy, while noting gaps such as weak string handling, missing generics, and fragmented tooling. There is also debate over the slow, conservative evolution of the standard, ISO’s paywalled official specification, and whether large legacy Fortran codebases should be ported to newer languages or instead better supported on modern accelerators like GPUs.

Language changes & standardization

  • Fortran 2023 is described as an incremental update over 2018 and 2008, with relatively few new features.
  • One notable semantic change: internal writes to allocatable character variables must now reallocate to match the written length instead of padding/truncating, which can break previously conforming code.
  • Some criticism that Fortran standardizes features before serious implementation/testing, leading to ambiguities and incompatible compiler behavior discovered years later.

Compiler support & tooling

  • Current open-source compilers mentioned: GFortran, LLVM Flang, and LFortran, all supporting “modern Fortran” but not yet full F’23.
  • Flang can warn about constructs whose semantics change under F’23.
  • Lack of a standard, widely adopted package manager is cited as a pain point, despite projects like FPM.

Why Fortran is still used

  • Major domains: numerical weather prediction, climate models, CFD, finite element analysis, geophysics, computational physics, crystallography, computational chemistry, bioinformatics, and nuclear/weapons codes.
  • Strong inertia: large, highly optimized legacy codes and expertise in scientific institutions and government labs.
  • Fortran is seen as relatively small and easy to learn for scientists/grad students compared to C++.

Performance vs other languages

  • Key advantage: strict rules on array aliasing and a more restrictive memory model enable aggressive optimization, especially for multidimensional arrays and slices.
  • C can theoretically match performance with restrict, careful coding, and even assembly, but this is described as fragile and effort-intensive versus Fortran’s defaults.
  • Fortran is compared to a “highly optimized Matlab” or NumPy-like array language; doing equivalent array work in C/C++ is viewed as cumbersome.
  • Debate over whether modern C++ abstractions and libraries (e.g., Eigen) have closed the gap; consensus that Fortran still makes high performance easier for non-expert programmers.
  • NumPy mostly calls C/BLAS/LAPACK; overhead of Python–FFI interaction can matter for small arrays.

GPU, ecosystem, and future

  • GPU support exists (e.g., CUDA Fortran) but open-source, portable solutions are seen as incomplete; this motivates some ports to Julia, C++, Python/JAX, or shaders.
  • Some say few truly new Fortran projects start outside traditional domains; others point to modern AI/ML inference frameworks and neural nets written in Fortran.
  • Community is reported as more active and organized than a decade ago; there’s interest in Fortran as a domain-specific language targeting common IRs (e.g., MLIR).

Standards access & ISO policy

  • Complaints about having to pay for the official ISO PDF; drafts of the standard are freely available and generally treated as sufficient and practically authoritative.