[J3] [EXTERNAL] Re: Re: Slides available for your preview - Part 2 of the Generics Tutorial today at the J3 plenary
William Clodius
w.clodius at icloud.com
Tue Mar 9 17:41:42 UTC 2021
Tom:
I would argue that the template parameters at the module template level is not necessarily the union of all the template parameters used by the actual templated entities contained therein. If templated modules can contain templated modules or templated procedures then the instantiations of these components can be separately specified relying on their partial instantiation from the instantiation of the enclosing templated module. There is no reason that a templated module should be any less flexible than a templated class in C++. However for compatibility with the existing language the same functionality will be wordier than in C++.
So far your examples have naturally focussed on simple cases, which of course have been templated algorithms, that don’t necessarily benefit from templated modules and hence don’t provide analyses of the features of templated modules. To examine the features of templated modules it is best to examine a couple of templated containers. Note that my additions to https://github.com/j3-fortran/generics/blob/main/Use_cases_and_requirements.md <https://github.com/j3-fortran/generics/blob/main/Use_cases_and_requirements.md> included some at least partial examples of containers.
Sincerely,
Bill
> On Mar 9, 2021, at 7:02 AM, Clune, Thomas L. (GSFC-6101) via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> Anton,
>
> It is not that parameterized modules cannot address the use cases. The problem is simply that the list of template parameters at that level is the union of all template parameters used by the actual templated entities contained therein. Magne says that experience in other languages as that well-designed templates will encourage extensions and the module-level approach will lead to long lists that are more difficult to use.
> Not a catastrophe. But not ideal either.
>
> If I understand correctly, you are endorsing parameterized modules against other solutions. None of which have yet been proposed. The examples in the tutorials were not even intended to address this particular issue. Rather they focused on small motivating examples for "restrictions" and potential ways to deal with the irregularities in existing Fortran syntax. Granted, the examples put the template parameters on the types and the procedures, but that was not the intent per-se. (I'll also grant that it does reveal a bias on the part of the presenters.) If nothing else, that makes the examples smaller by a few lines each which is useful in PPT.
>
> Cheers,
>
> - Tom
>
> <snip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210309/19296a3c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1619 bytes
Desc: not available
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210309/19296a3c/attachment-0001.bin>
More information about the J3
mailing list