Open
Description
There are several features in Fortran many of us wish to see changed / deprecated in order to support and enforce modern programming practices (see for example . Unfortunately doing so would break backwards compatibility of the language, which would sacrifice one of Fortrans advantages.
What about adding a keyword to the language, which indicates the language version of the code in a given unit (module). Something like:
module my_modern_module
language_version 2022
...
end module my_modern_module
All module files without explicit language version keyword would be treated as having code complying to the last standard without this keyword (e.g 2018). All module files with the language version keyword would be treated accordingly to the specified version.
Advantages:
- One could deprecate features much faster without fearing to break backwards compatibility.
- The user would not have to deal with compiler specific flags to enforce a given practice or language standard (like
-assume realloc_lhs
or similar). Especially, if you have source files with different language standards in a project (no nice, but can happen), you won't need to fiddle with the compilation options for each file individually. - A single line could enforce several requirements without too much verbosity, so instead of having
one would just write
implicit none(type, external) implicit save off short_circuiting on ...
to profit from all the features / requirements a given Fortran standard offers / enforces.language_version 2022
- Finally, its marketing value would tremendous. Every source file in a modern Fortran project, every slide presented in a Fortran course, would advertise, that this beautiful language, despite being the first high level (modern!) language, is still alive and is able to adapt to the requirements of the present.