Fortran for C++ programmers ... guidelines?

During the FortranCon 2020 conference last week someone raised the question whether there is any resource out there that can help C++ programmers get acquainted with Fortran. Guidelines are available for various combinations of programming languages, but none it seems for this particular direction.

Does anyone know of such a guide? If not, I suggest it could be a nice contribution to the fortran-lang tutorials.

Regards,

Arjen

4 Likes

I think we should have a guide for Python programmers, e.g., along this:

https://www.fortran90.org/src/rosetta.html

and we should have a similar guide for C++ programmers. Showing familiar constructs in C++, and how to do them in Fortran.

There’s a fairly comprehensive document in the new flang docs directory: fortran for c programmers which compares high-level terminology and concepts.

This is something I am hoping to be able to bring to fortran-lang learn section.

@lkedward that document is a good start. I was hoping to have lots of code side by side examples. At least for me examples are the most helpful.

I haven’t come across any existing Fortran-C++ Rosetta stones but, like your Python effort, this is certainly something we should put together.

1 Like

I have mailed with Gary Klimowicz, one of the authors of the flang page, and he agreed that we use the ideas written there to set up such a guide. Together with the examples from the rosetta page, that should do the trick.

3 Likes

I know of an opposite guide: C++ for Fortran Programmers. There is also book on C for Fortran Programmers. Both are pre-F2003, meaning OO features and C interoperability where not yet part of the Fortran standard.

There is also lecture by Kevin Cowtan on C++ for Fortran Programmers with side-by-side examples of language constructs.

The FeatFlow finite element package also has an Overview about Fortran 90/95 for C/C++ programmers.

3 Likes

Ivan, thanks for these pointers - I will look into this material.

Regards,

Arjen

1 Like