From owner-sc22wg5@open-std.org  Thu Nov  6 01:00:48 2008
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom7
Delivered-To: sc22wg5-dom7@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 55C4DCA343A; Thu,  6 Nov 2008 01:00:48 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from mail.jpl.nasa.gov (sentrion1.jpl.nasa.gov [128.149.139.105])
	by www2.open-std.org (Postfix) with ESMTP id 6B8C8CA3434
	for <sc22wg5@open-std.org>; Thu,  6 Nov 2008 01:00:46 +0100 (CET)
Received: from mprox2.jpl.nasa.gov (mprox2.jpl.nasa.gov [137.78.160.141])
	by mail.jpl.nasa.gov (Switch-3.3.2mp/Switch-3.3.2mp) with ESMTP id mA600eOS013973
	for <sc22wg5@open-std.org>; Thu, 6 Nov 2008 00:00:43 GMT
Received: from [137.79.7.57] (math.jpl.nasa.gov [137.79.7.57])
	(authenticated bits=0)
	by mprox2.jpl.nasa.gov (Switch-3.2.6/Switch-3.2.6) with ESMTP id mA600cOk019666
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <sc22wg5@open-std.org>; Wed, 5 Nov 2008 16:00:38 -0800
Subject: Re: (j3.2006) (SC22WG5.3623) [ukfortran] A comment on John
	Wallin's comments	on	Nick MacLaren's comments
From: Van Snyder <Van.Snyder@jpl.nasa.gov>
Reply-To: Van.Snyder@jpl.nasa.gov
To: sc22wg5 <sc22wg5@open-std.org>
In-Reply-To: <20081105232803.42621CA3434@www2.open-std.org>
References: <20081105225653.DCEA7CA3428@www2.open-std.org>
	 <20081105232803.42621CA3434@www2.open-std.org>
Content-Type: text/plain
Organization: Yes
Date: Wed, 05 Nov 2008 16:00:38 -0800
Message-Id: <1225929638.26045.164.camel@math.jpl.nasa.gov>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.2) 
Content-Transfer-Encoding: 7bit
X-Source-IP: math.jpl.nasa.gov [137.79.7.57]
X-Source-Sender: Van.Snyder@jpl.nasa.gov
X-AUTH: Authorized
Sender: owner-sc22wg5@open-std.org
Precedence: bulk


On Wed, 2008-11-05 at 15:28 -0800, N.M. Maclaren wrote:
> Anyway, I regard the right solution to this is that every derived type
> should have code and decode primitives, and that you should transfer
> the encoded form.  You need them for a great many purposes, including
> unformatted I/O, not just MPI.
> 
> > The important thing to note is that every time a grad student adds a
> > single element to the data structure, you have to alter the block
> > counts and sizes by hand.
> 
> Sorry, but no.  There are better solutions.  I agree that none are
> pretty, and all involve enforcing strict discipline on the
> programmers, but they have been known since time immemorial.
> Parameterisation is the key.

Clause 9 of the Fortran standard already does this.  It makes my head
hurt to write the encode and decode primitives for every derived type,
and then rewrite them whenever a tiny detail changes.  I suppose I could
use internal I/O, which on some systems many years ago was provided by
ENCODE and DECODE statements.  I'd rather use coarrays, and if they're
not available I'd rather use unformatted I/O.

-- 
Van Snyder                    |  What fraction of Americans believe 
Van.Snyder@jpl.nasa.gov       |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or
disapproved by JPL, CalTech, NASA, the President, or anybody else.

