Mixed source (C+Fortran) compilation

Richard Biener richard.guenther@gmail.com
Fri Feb 3 15:57:00 GMT 2017


On February 3, 2017 12:06:34 PM GMT+01:00, ghime <ghime@live.com> wrote:
>Dear Fortran users and developers,
>
>I've been brainstorming with some colleagues (in HPC for climate
>sciences)
>the idea of having a C compiler front-ends to accept inline Fortran
>blocks,
>much the same way they (most? all?) accept inline Assembly. There are
>several reasons why this would be interesting, all of them boiling down
>to
>narrowing/erasing the gap between C and Fortran, both technical and
>cultural. We are pitching this idea to members of the HPC community.
>The
>plan would be to have a proof-of-concept patch of gcc/gfortran.
>
>Some of the long-term consequences, if this ever becomes reality, would
>be:
>
>- Mixed-source files would enable/force scientists to learn "that other
>language".
>- Integration would make it easier to achieve/enforce code uniformity
>and
>reduce duplications.
>- Performance would be increased by having each language do what it
>does
>best without resorting to function calls.
>
>I'd like to hear peoples thoughts, preferably constructive ones. This
>is not
>something of which benefits would be reaped soon, yet not-soon can come
>quite quickly in software development, if there is a will and a way. I
>believe the way is quite well-paved in the current state of the gcc
>compiler
>suite.

You need to define how the inline FORTRAN sequence interacts with the surrounding C code.  The current way of having a function boundary between them makes this easy.

Oh, and you probably way underestimate the technical challenge of marrying two frontends.

Richard.

>Cheers,
>
>Gustavo
>
>
>
>--
>View this message in context:
>http://gcc.1065356.n8.nabble.com/Mixed-source-C-Fortran-compilation-tp1346493.html
>Sent from the gcc - fortran mailing list archive at Nabble.com.



More information about the Fortran mailing list