It has come to my attention that we are missing something in iso_fortran_env. After careful study of the Fortran 90 i1mach.f90 it seems we can update it even more using Fortran 2008. We can replace some of the last few hard-coded value with these intrinsics:
I fear it would transform Fortran into a punching bag outside our community…
I read in Abstracting Away the Machine that the original FORTRAN compiler had the PUNCH intrinsic, similar to PRINT but for punched cards. But it was already more modern with WRITE TAPE and WRITE DRUM. It was so long ago they do not even appear in the Deleted and obsolescent features section of the Fortran standard…
Is it not already planned for the Fortran 2057 standard? I think we can expect that “century” version to be a major one. Good news, Ph.D. students can hope to use it before retirement!
Oh yes, Fortran 2057 is going to be epic! Two new arguments to implicit none, yet a third half-baked implementation of enumerators, 10,000 new IEEE routines that nobody needs, and two new trivial string manipulation routines (uppercase() and lowercase()). Unfortunately, exception handing will again be postponed so there’s time to “get it right”. No need to be hasty.
@vmagnin brought up Annex B Deleted and obsolescent features which clearly shows there are limits to backward compatibility in Fortran with the following notable features having been deleted after Fortran 90 was published:
“Real and double precision DO variables”
“Branching to an END IF statement from outside its block.”
“PAUSE statement”
“ASSIGN and assigned GO TO statements, and assigned format specifiers”
Hollerith “H edit descriptor”
“Vertical format control”
Recently at work I came to know of a team using licensed commercial software from a company based in northeast US with a legacy FORTRAN backend that was refactored to
avoid implicit mapping (nearly 95% of the subroutines and functions use IMPLICIT NONE, the remaining IMPLICIT INTEGER(I-N), DOUBLE PRECISION(A-H,O-Z); this was about 30 years ago,
make all Fortran subprograms recursive and reentrant; this was about 12 years ago - as part of this, legacy COMMONs used initially were somehow mapped to C structs (I don’t have the details as to how) and migrated to a C driver layer and the Fortran code was checked thoroughly to have no SAVE attribute with any objects.
However for some unstated reason they retained the use of Hollerith constants and H edit descriptor and also the vertical spacing for use with the reports being generated! That is, continue to use items 5 and 6 included in Fortran 90 standard but which were later deleted.
Thus the fact this codebase “breaks” due to deletions from the standard after Fortran 90 is supposedly ok but asking the Fortran standard to standardize a couple of crucial practices such a codebase would like e.g., default of IMPLICIT NONE is not ok is not at all healthy for Fortran. It makes it an animal farm at present with some more equal than others.
If the above 6 items could be deleted, backward compatibility be damned, then implicit mapping and implied save can also be deleted.
Mathematicians put aside, who would on Earth need to declare a non integer i variable?
How many code lines could be saved by that exquisite feature? Our productivity would be improved and some bytes would be saved on our hard drives.
I even propose that implicit none become compulsory. But you could go back to the old behavour with:
implicit none except all
Note: now the problem is that if you want to declare an implicit variable named all, we should think about a syntax to avoid any ambiguity… Any idea?
My preference would be to rip out the old nonsense quickly, like removing a band-aid!! The sooner the better. Modern Fortran is a great language, but the old stuff is an embarrassment, and constant source of errors and confusion. It just has to go. Why delay? There’s no reason to trickle out the deletions over decades, just do it all at once. Everybody knows what needs to be removed (the stuff nobody should be using in the first place).
That seems ill-defined to me. What does it mean “numeric storage unit”? Is that always the same as storage_size(1) (which is clear is the storage size of the default integer)?
It’s always an option to fork Fortran and make a better language and implementation. Users who don’t need backward compatibility probably don’t need the standard, so why chain yourself to the standard? To help with the new effort, here are some name ideas which I think would be cool for the new language: