Skip to content

Language version keyword #83

Open
Open
@aradi

Description

@aradi

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
    implicit none(type, external)
    implicit save off
    short_circuiting on
    ...
    
    one would just write
    language_version 2022
    
    to profit from all the features / requirements a given Fortran standard offers / enforces.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Clause 8Standard Clause 8: Attribute declarations and specifications

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions