comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Fortran 77 to Ada
Date: 1999/11/22
Date: 1999-11-22T00:00:00+00:00	[thread overview]
Message-ID: <81bp45$43r$1@nnrp1.deja.com> (raw)
In-Reply-To: 38361943.813C2E20@acenet.com.au

In article <38361943.813C2E20@acenet.com.au>,
  Geoff Bull <gbull@acenet.com.au> wrote:
> Below is the header which should help you find it.
> Don't be put off by the Ada-95, I don't recall seeing anything
> generated that wasn't Ada-83 (apart from some complete
rubbish,
> of course. Since, it's GPL'd, I can mail it to you if you
can't
> find it on the web.


Actually it is quite impossible to generate a general Fortran
to Ada-83 translator, with any kind of reasonable quality in
the output.

Why? Because it is part of the fundamental semantics of Fortran
that arrays are stored in column major order, and programs can
and do depend on this.

As a result, if you are translating code for multi-dimensional
fortran arrays into Ada 83, you have no choice but to manually
linearize all arrays into single dimension arrays, a step that
will badly damage the semantic level of the output.

In Ada 95, the pragma Convention (Fortran, ...) that ensures
column major order for an annex G compliant compiler (*) helps
to generate reasonable code in far more cases [though if your
translator promises 100% conversion, then indeed it would still
have to do nasty things like pass all arrays by explicit use of
the Address attribute]

(*) note to T.E.D. yes, this is implementation advice (see RM
    3.6.2 (11)). But of course the reason this is IA is
    precisely that it would be hard to formalize this
    requirement. You should certainly make sure that any
    Ada compiler you are going to be using in a Fortran context
    supports this important feature!



Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~1999-11-22  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-19  0:00 Fortran 77 to Ada Chris
1999-11-20  0:00 ` Geoff Bull
1999-11-22  0:00   ` okellogg
1999-11-22  0:00   ` Robert Dewar [this message]
1999-11-20  0:00 ` Robert Dewar
1999-11-22  0:00   ` Ted Dennison
1999-11-22  0:00   ` Gautier
1999-11-22  0:00     ` Robert Dewar
     [not found]       ` <foY6OBD5gjcPjzWrpLelVV=Ml6VL@4ax.com>
1999-11-25  0:00         ` Simon Wright
replies disabled

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