[J3] Polymorphic C_LOC actual argument pointer-associated with an interoperable type: conforming?

Damian Rouson damian at sourceryinstitute.org
Wed May 23 00:19:36 EDT 2018

On May 22, 2018 at 7:03:29 PM, Malcolm Cohen via J3 (j3 at mailman.j3-fortran.org) wrote: 

I don’t know why one wouldn’t write CFI_address in C, seeing as how it’s doing stuff with a C descriptor, which is NOT required to be interoperable with Fortran anyway!

Thanks for your feedback, Malcolm.  I won’t disagree with anything you wrote.  As for the motivations, they are twofold:

1. Fortran implementations are more compact by a long shot. The developer who was working on this with me just finished writing C implementations of the ISO_Fortran_binding.h functions and he was really excited about the complexity reductions we were observing as we started down the path of writing the same function in Fortran.  For example, he used recursion to calculate the memory address in C that we were able to calculate in a single short line in Fortran using a C_LOC invocation with a subscripted array argument.

2. Having Fortran implementations attract a different and more readily available set of contributors for maintaining the resulting code.  We are going to release the C implementations as part of OpenCoarrays for several reasons, but the number one reason is that two developers (neither of them being me) have sunk weeks of their lives into failed attempts to modify the GCC autotools build system to accomplish seemingly simple tasks, including getting it to install ISO_Fortran_binding.h and build the corresponding functions into a library. Both developers have given up on this simple task after trying it and at least one did quite a lot of yelling and cursing at the screen along the way.  OpenCoarrays users are more likely to contribute to maintaining the resulting code if it’s in Fortran both because most OpenCoarrays users prefer Fortran and because of the aforementioned complexity reduction.

Anyway, this C implementations are done and those will be released regardless of whether the Fortran implementations ever materialize. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20180522/d6e5e4d0/attachment.html>

More information about the J3 mailing list