(j3.2006) (SC22WG5.5067) [ukfortran] J3 work plan
N.M. Maclaren
nmm1
Tue Aug 6 03:31:39 EDT 2013
On Aug 6 2013, Malcolm Cohen wrote:
>>
>>Concerning UK-10.1a (delete arithmetic IF), my colleagues who have
>>millions of lines of legacy code to maintain are concerned about the
>>amount of work this might impose on them.
>
> One might opine that eliminating arithmetic IF should have been thought
> about for approximately 30 years, or more charitably 20+ years ago when
> it became obvious that IEEE arithmetic was a serious force in the land.
Agreed, regretfully. Actually, make it 35 years, because the original
reasons for replacing it were to clarify code by reducing the number of
labels. Any program that has two labels the same in an arithmetic IF
hasn't been cleaned up since Fortran 66.
> If someone wishes to assert that their codes don't need to handle NaNs,
> the difficulty of the work ranges from the trivial to the utterly
> trivial. Not to mention automatable in fact decades ago Toolpack had a
> tool which eliminated arithmetic IF except when all 3 labels were
> different (which does occur, but is a small minority).
Yes. The semantics of arithmetic IF are very useful, which is why
a few people continued to use it in Fortran 77 code, but it really
doesn't fit with the IEEE model. And its syntax is SO 1950s ....
In the world of today, writing a Python (or whatever) script to
replace all arithmetic IFs (including 3 label ones) by logical IFs
isn't even hard.
>>frowned upon in their style guides
>
> One might have thought that Arithmetic IF ought to have been frowned on
> in their style guides for the last 35 years too, for fairly obvious
> reasons.
Personally, in an abstract language, I would favour retaining the
semantics of arithmetic IF (not the syntax!) and fixing IEEE 754, as in
SNOBOL or as proposed in IEEE 754R. But I and people like me have lost
that battle and, like it or lump it, the IEEE 754 arithmetic model
rules today and will continue to do so for at least a couple of decades.
Fortran has to live in the computing world that is, and not one that
only us old fogies can remember.
Regards,
Nick Maclaren.
More information about the J3
mailing list