[J3] BIND(F)?

Jeff Hammond jehammond at nvidia.com
Tue Jun 28 15:27:29 UTC 2022

On 28Jun 2022, at 6:03 PM, Bill Long <billlong at centurylink.net<mailto:billlong at centurylink.net>> wrote:

External email: Use caution opening links or attachments

On Jun 28, 2022, at 8:58 AM, Long, Bill F <william.long at hpe.com<mailto:william.long at hpe.com>> wrote:

For example, math libraries do not need to do I/O*, but are a very important use case in Fortran applications.  If we merely solved interoperability for arrays of built-in datatypes, it would be quite useful.

At which point we step on the 3rd rail of numerical computing - x87 80-bit floating format or 128-bit IEEE floating format.  Some compilers (notably Intel) support the x87 format, others don’t.

80-bit x87 is not one of the standard types, whereas real128 is.  “real80" is never going to be portable and is a distraction.  I doubt Intel even cares at this point, given that their compiler almost never emits an x87 instruction, and the primary use of it is in the scalar transcendental function library, which is written in assembly.  If 80-bit floating point was important, it would be part of the SSE/AVXn instruction sets.

* That XERBLA exists instead of a more more form of error handling is not proof that this I/O necessary.

Another example is strings.  How does one make a portable library that takes string arguments?  Is it really a project-ending disaster to standardize the calling convention for strings?

Strings can be passed to C in an interoperable fashion.

Yes, and one can write interoperability between any two Fortran compilers by converting everything through C, but nobody wants to do that, and I’d be surprised to learn that a single user has ever done this, for something nontrivial.

Is this our best response to users who want to build portable libraries: use C bindings for everything?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220628/b9a4ebaf/attachment-0001.htm>

More information about the J3 mailing list