[J3] [EXTERNAL] Re: Slides available for your preview - Part 2 of the Generics Tutorial today at the J3 plenary
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Mon Mar 8 22:03:27 UTC 2021
On 3/8/21, 4:53 PM, "J3 on behalf of Bill Long via J3" <j3-bounces at mailman.j3-fortran.org on behalf of j3 at mailman.j3-fortran.org> wrote:
HI Tom,
I’m becoming convinced that the “strong restrictions” part of the proposal is a big mistake, an extra implementation complication, and serves no useful purpose. The compiler should be able to figure out the effective restrictions based on the usage of the dummy arguments. It is reasonable to require that any procedure called in the template have an explicit interface. Or maybe contained in a module if it is not intrinsic. Putting support routines in a module is a pretty natural programming style anyway.
Bill,
I'm sorry that you feel this way. As stated in my tutorial, subgroup is convinced that this is essential, and this is based upon experience from users and implementors in other languages, including Magne.
And as stated in the tutorial there are cases where the compiler simply cannot figure out the restrictions from the types of the dummy arguments. As Gary attempted to explain it is a combinatorial explosion and a huge burden on the compiler to figure this out - unless it is deferred to the time of instantiation whereupon it becomes trivial to check. We want library implementors to be able to develop robust templates that can be debugged prior to instantiation.
I'll try to put together a more realistic example where intermediate types are involved and a compiler could not readily determine the restrictions prior to instantiation.
Cheers,
- Tom
Cheers,
BIll
> On Mar 8, 2021, at 3:05 PM, Clune, Thomas L. (GSFC-6101) via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> With regard to your last statement about strong restrictions: our definition of “strong” in this context is that there will be constraints in the language specification such that (a) a template that does not provide a full set will not be standard conforming and (b) that the processor will be required to diagnose missing restrictions. Of course, I have no idea yet on how that would look in bnf, but it does not sound too onerous in the grand scheme of things.
Bill Long longb at hpe.com
Engineer/Master , Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Hewlett Packard Enterprise/ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
More information about the J3
mailing list