From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Tue Aug  6 09:31:57 2013
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 2B0963571A3; Tue,  6 Aug 2013 09:31:57 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from ppsw-52.csi.cam.ac.uk (ppsw-52.csi.cam.ac.uk [131.111.8.152])
	by www.open-std.org (Postfix) with ESMTP id B77B935693E
	for <sc22wg5@open-std.org>; Tue,  6 Aug 2013 09:31:40 +0200 (CEST)
X-Cam-AntiVirus: no malware found
X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/
Received: from hermes-0.csi.cam.ac.uk ([131.111.9.18]:37917)
	by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:25)
	with esmtpa (EXTERNAL:nmm1) id 1V6bk3-0008Ej-Fq (Exim 4.80_167-5a66dd3) for sc22wg5@open-std.org
	(return-path <nmm1@hermes.cam.ac.uk>); Tue, 06 Aug 2013 08:31:39 +0100
Received: from prayer by hermes-0.csi.cam.ac.uk (hermes.cam.ac.uk)
	with local (PRAYER:nmm1) id 1V6bk3-0006Qe-T9 (Exim 4.72) for sc22wg5@open-std.org
	(return-path <nmm1@hermes.cam.ac.uk>); Tue, 06 Aug 2013 08:31:39 +0100
Received: from [87.112.137.190] by old-webmail.hermes.cam.ac.uk
	with HTTP (Prayer-1.3.5); 06 Aug 2013 08:31:39 +0100
Date: 06 Aug 2013 08:31:39 +0100
From: "N.M. Maclaren" <nmm1@cam.ac.uk>
To: sc22wg5 <sc22wg5@open-std.org>
Subject: Re: [ukfortran] (SC22WG5.5066)  J3 work plan
Message-ID: <Prayer.1.3.5.1308060831390.22771@hermes-0.csi.cam.ac.uk>
In-Reply-To: <20130806033048.0FA54357223@www.open-std.org>
References: <20130806024859.06A1C35721F@www.open-std.org>
 <20130806033048.0FA54357223@www.open-std.org>
X-Mailer: Prayer v1.3.5
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

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.

