comp.lang.ada
 help / color / mirror / Atom feed
From: "Howard W. LUDWIG" <Howard_W_Ludwig@ccmail.orl.mmc.com>
Subject: Re: C to Ada translator (was: Ada to C translator)
Date: 1997/02/07
Date: 1997-02-07T00:00:00+00:00	[thread overview]
Message-ID: <32FB5BD2.A79@ccmail.orl.mmc.com> (raw)
In-Reply-To: 32F5DB0D.66D9@stgl.sel.alcatel.de


Martin Krueger wrote:
> 
> Larry Kilgallen wrote:
> >
> > In article <32E4C115.55BD@iies.es>, Gabriel Rouzaut <gabmrou@iies.es> writes:
> > > Does anybody knows any tool to translate Ada source files to
> > > C/C++ source files?. I was looking for it on the net, but I
> > > couldn't find any.
> >
> > The consensus in comp.lang.ada from the _many_ times this has been
> > addressed in the past is that no general purpose translator could
> > be built since the semantics of Ada are a superset of the semantics
> > of C or C++ (no tasking for example).  Please read archives of the
> > comp.lang.ada rather than starting the discussion up from scratch.
> >
> 
> As Ada is the superset, is it then possible to translate C-code in Ada?
> I could make use of such a translator to facilitate the rewriting of a
> (supposedly buggy) C-library in Ada.
> 
>         M A R T I N
> 
> --
>                                           _____
>  Dr. Martin Krueger                      |.---.|
>  Alcatel SEL AG, TS/PF                   ||___||      |\__/,|   (`\
>  D-70435 Stuttgart                       |o  --|\     |o o  |__ _) )
>                                          :=====: )  _.( T   )  `  /
>  +49 711 821-49003, Fax:46776                   (_ ((_ `^--' /_<  \
>  martin.krueger@stgl.sel.alcatel.de             /_/   `-'(((/  (((/

The Ada FAQ addresses reasons for not translating from language x to Ada. 
 In particular, one basically has an x-based design expressed in Ada 
syntax.  Thus, one does not have the advantages offered by Ada for 
maintnenance, reuse, etc.  Also, the code was probably originally written 
to support optimization by an x compiler but the translated code does not 
typically fit well with optimization by an Ada compiler.  (The 
traditional example between Fortran and Ada 83 involves the use of 
multidimensional arrays and what order the indexes should be in for 
optimized throughput.)

However, the situation discussed in the original post is even more 
troublesome because of the reference to "buggy".  Are the problems 
relatively simple typographical issues (such as == versus = in a 
conditional or how many asterisks for how many levels of pointer 
dereferencing) or are they fundamental design flaws (the boundary between 
the two being rather fuzzy)?  If there is the suspicion of design flaws, 
I expect one would be better off redesigning basically from scratch with 
Ada concepts in mind.  Otherwise, one simply translates flaws from one 
language to Ada and in a manner where Ada cannot offer its usually 
superior error-checking capability.

Perhaps there is in this case an issue of a very large library and only a 
few errors so the only viable way to handle that many lines of code 
within a certain budget or time frame is to get help from an automated 
process.  However, I would be very careful about using that as an excuse 
to not evaluate critically the design from an Ada standpoint and consider 
starting from scratch.  (At least the requirements for what the library 
needs to do should stay intact.)

Howard W. LUDWIG, Ph.D.
Howard_W_Ludwig@ccmail.orl.mmc.com




  parent reply	other threads:[~1997-02-07  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-21  0:00 Ada to C translator Gabriel Rouzaut
1997-01-22  0:00 ` Larry Kilgallen
1997-01-24  0:00   ` Ted Dennison
1997-01-30  0:00   ` Keith Thompson
     [not found]   ` <32F5DB0D.66D9@stgl.sel.alcatel.de>
1997-02-07  0:00     ` Howard W. LUDWIG [this message]
     [not found]   ` <5d29nv$sqv@mn5.swip.net>
     [not found]     ` <dewar.854940250@merv>
     [not found]       ` <5ddp0u$elq@mn5.swip.net>
1997-02-09  0:00         ` Robert Dewar
replies disabled

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