comp.lang.ada
 help / color / mirror / Atom feed
From: Chris M Moore <zmower@ntlworld.com>
Subject: Re: Making the same mistake as the broken C interface to fortran
Date: Wed, 3 Jul 2019 22:31:44 +0100
Date: 2019-07-03T22:31:44+01:00	[thread overview]
Message-ID: <499TE.1270744$Ud5.547915@fx12.am4> (raw)
In-Reply-To: <qfiu4j$oaq$1@franka.jacob-sparre.dk>

On 03/07/2019 20:02, Randy Brukardt wrote:
> "Chris M Moore" <zmower@ntlworld.com> wrote in message
> news:2uYSE.298383$sJ3.119314@fx04.am4...
> ...
>> So the question is do we break the API or not?
> 
> That's not the question. The question is ensuring that the Ada compiler
> properly implements the Fortran convention. If it does, then the API doesn't
> change. And if it doesn't, then fix the silly compiler (or get a different
> one that does the right thing). The Annex B "Implementation Advice"
> (specifically, B.5(22-26)) is very close to a requirement, in that the
> interface is not useful if one can't depend on the mapping.
> 
<snip>
> 
> BTW, I note that type Fortran_Character is in fact an array type, so that
> could be confusing some readers of the API (it surely would have confused
> me).

I'm sure GNAT does the right thing if you're using Fortran_Character. 
Unfortunately the bindings use Standard.Character.

>> We could make the
>> bindings thicker and thus slower.  Or break the typing and force client
>> software to change.  The software engineer in me says the former but I'm
>> not a user of this API so I doubt my views count for much.

Or maybe the answer is both.  Leave in the Character interface with a 
body to do the conversion and add another version to do the thin wrapper 
using Fortran_Character.  Nothing breaks but if speed becomes a problem 
then switch to using the proper thin version.

Chris

-- 
sig pending (since 1995)


  reply	other threads:[~2019-07-03 21:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 23:33 Making the same mistake as the broken C interface to fortran Chris M Moore
2019-07-02 20:57 ` Simon Wright
2019-07-03  7:06   ` Chris M Moore
2019-07-03 19:02     ` Randy Brukardt
2019-07-03 21:31       ` Chris M Moore [this message]
2019-07-04  8:38         ` Simon Wright
2019-07-05 13:49           ` Chris M Moore
2019-07-05 17:44             ` Simon Wright
2019-07-07 16:33               ` Chris M Moore
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox