Online fortran tutorials
Ted Byers
r.ted.byers@rogers.com
Fri Jan 18 17:25:00 GMT 2008
--- Daniel Franke <franke.daniel@gmail.com> wrote:
> On Thursday 17 January 2008 21:50:59 Ted Byers
> wrote:
> > --- Daniel Franke <franke.daniel@gmail.com> wrote:
> > > On Thursday 17 January 2008 18:55:19 Ted Byers
> > >
> > > wrote:
> > > > But I don't know even if there is a fortran
> > > > equivalent to the templates I love in C++.
> > >
> > > As far as I can tell, up to F2003, there isn't.
> > > However, one can do generic programming of some
> sort.
> > > Have a look at the FLIBS [1] project of Arjen
> > > Markus for examples.
> >
> > Thanks Daniel. Good to know.
> >
> > But templates are not just for generic
> programming,
> > although that was the origincal intent. For
> example,
> > using template metaprogramming
>
> I'm aware of the metaprogramming in C++
> (Alexandrescu, "Modern C++ Design" may
> be recommended here), but there's no way to emulate
> that in Fortran. That is,
> none I know. If you learn about one, I'd like to
> hear about it :)
Yet another example of an outsanding book! I know,
and have them all for C++, but my library for fortran
is a little sparse. :-(
It looks like I may have to work up some examples
using C++, and then ask some fortran gurus for ideas
on how best to work up fortran code that can compete.
I am sure it must be possible, but I don't yet know
how.
>
> I loosly scanned the first draft of F2008. There is
> nothing prominent that
> indicates that templates/metaprogramming will become
> part of the standard any
> time soon ...
>
But it may be just a matter of time.
It takes us a little off topic, but for years the java
community disparaged templates as glorified macros.
But now generics has been added to java; a significant
enhancement I greatly appreciate! I expect that
within five to ten years, java will have support for
template metaprogramming at least comparable to what
is generally available in C++ now.
Yes, generics in Java, as it is right now, is
seriously crippled, but it shows a significant
movement in the java programming community from the
generally hostile attitude it had just a few years ago
to what looks like a reluctant acknowledgement of the
utility of generics; and it seems to me that full
support for generic programming is a necessary and
sufficient condition to full support for template
metaprogramming. On that expectation, one could infer
from what you said, vis. "one can do generic
programming of some sort," that at least some
primitive metaprogramming may be possible, if not now
then RSN. Maybe?
Thanks again.
Cheers,
Ted
More information about the Fortran
mailing list