Please see this:
Issue #90 proposes to eliminate implicit typing in Fortran. There is strong resistance to this, there being a major concern that to “eliminate implicit typing”, if pursued with any seriousness, will require a deletion of the IMPLICIT
statement from the language. There is great worry some existing code would break as a result.
Can the Fortran community then coalesce to a somewhat simpler proposal, to eliminate implicit mapping instead?
The main aspect of such a proposal is to primarily change one sentence in the section on IMPLICIT statement to introduce the following:
“If a mapping is not specified for a letter, the default for a program unit or an interface body shall be NULL, and the default for a BLOCK construct, internal subprogram, or module subprogram is the mapping in the host scoping unit”
Note the current Fortran standard (document 18-007r1) instead states in section 8.7 IMPLICIT STATEMENT
page 114, paragraph 3, lines 32-34, “If a mapping is not specified for a letter, the default for a program unit or an interface body is default integer if the letter is I, J, ..., or N and default real otherwise, and the default for a BLOCK construct, internal subprogram, or module subprogram is the mapping in the host scoping unit.
”
This one sentence effectively ends up achieving backward compatibility with code written from the days of FORTRAN I where “ICARUS was an integer unless specified as REAL”, to paraphrase a long-standing joke with FORTRAN! The proposal is to modify this sentence as indicated in bold above
But now almost all the code written from the days of FORTRAN 77 then has tried to avoid the fate of the legend and not drown while trying to only take flight via the explicit use of the IMPLICIT statement, IMPLICIT NONE
overwhelmingly but IMPLICIT INTEGER(I-N), xx(A-H,O-Z)
{xx = DOUBLE PRECISION
, REAL
, REAL*8
, etc.]. This proposal intends fully not to affect in any adverse manner any such existing code that makes explicit use of IMPLICIT
statements.
The intended benefit of this one modification is to set in motion finally a positive change where IMPLICIT NONE
becomes the default in any and all program units and in all the interface bodies, gone will be the need to ensure the inclusion of implicit none
in a list of explicit interfaces:
interface
function foo(..) result(..)
[import .. ]
implicit none !<-- Per current standard, forget this and face peril
..
end function
function bar(..) result(..)
[import .. ]
implicit none !<-- Per current standard, forget this and face peril
..
end function
subroutine foobar(..)
[import .. ]
implicit none !<-- Per current standard, forget this and face peril
..
end subroutine
end interface
Almost every processor tries to offer a compiler option to enforce the gist of this proposal, with fpm
and LFortran considering making this even the default. Why not standardize all such good intent?
What say you all, can you support this for Fortran 202Y? Please keep in mind even with 202Y, it may be year 2040 by the time this can become practicable. Is it not time now to start giving this a serious consideration?
Please provide your feedback preferably at the above GitHub site for Fortran proposals, or here?