(j3.2006) (SC22WG5.3584) OPTIONAL arguments and C interop

Aleksandar Donev donev1
Thu Jul 17 13:36:52 EDT 2008


On Thursday 17 July 2008 09:09, Jim Xia wrote:
> mance. ?Call by value is known as a performance killer in other languages.
> ?The compiler, not language, should be smart enough to decide what the best
> calling convention to use (whether or not get registers involved).
Yes, for Fortran-to-Fortran, it may have the freedom to decide the calling 
convention on-the-fly. But people often write codes to be used with other 
languages, even long before Interop, and platforms/compilers have ABI's to 
follow, so I am not aware of many compilers that actually use the full 
freedom and change calling conventions on-the-fly. When it comes to Interop, 
one must standardize, and this is why VALUE was added. J3 apparently has 
operated under the principle that one cannot just add VALUE for Interop, but 
rather, it must be integrated with the rest of Fortran. This leads to 
polymorphic VALUE arguments or OPTIONAL VALUE arguments and other stuff that 
while it not unreasonable, are certainly not worth the complication to 
implementation and confusion about performance impacts. One can *always* make 
a copy inside the routine if one really wants a copy! What's done is 
done...but, that does not mean the TR has to be messed up just to accomodate 
past bad choices, IMO.
Best,
Aleks




More information about the J3 mailing list