(j3.2006) (SC22WG5.3628) [ukfortran] A comment on John Wallin's comments on Nick MacLaren's comments
N.M. Maclaren
nmm1
Thu Nov 6 02:43:26 EST 2008
On Nov 6 2008, Van Snyder 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.
>
>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.
Internal files have been provided since Fortran 77! Yes, I remember ENCODE
and DECODE, in many different variants, but let's move on. Also, let's
skip the unnecessary restrictions on internal file use, which are a pain.
You are using coarrays to solve a problem that has nothing to do with
parallelism per se. While that is a perfectly reasonable decision from a
programmer's viewpoint, it is a damn bad basis for designing a standard!
Also, my point is that general derived types will contain pointers - and
you have no option but to encode and decode THOSE! I should prefer for
a language and program design paradigm to get the general case right,
rather than to have a collection of special-case hacks.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1 at cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679
More information about the J3
mailing list