comp.lang.ada
 help / color / mirror / Atom feed
From: wardi@rsd.bel.alcatel.be (Ian Ward)
Subject: Re: Ada to C/C++ translator needed
Date: 1996/09/26
Date: 1996-09-26T00:00:00+00:00	[thread overview]
Message-ID: <52e5t5$m28@btmpjg.god.bel.alcatel.be> (raw)
In-Reply-To: 32499FA0.4B5E@magic.fr


In article 4B5E@magic.fr, Emmanuel Champommier <echampommier@magic.fr> () writes:
>I'm looking for an Ada to C (or C++) translator.
>
>Does anyone knows where I could find it ?
>
>Thanks
>-- 
>                               E. Champommier
>                           (echampommier@magic.fr)
>

I have seen this request several times, and it seems to me
to be not an easy thing to write. Converting 'C' to Ada, I 
guess involves a lot less donkey work than the other way 
around.

This is because for almost each construct in 'C' and 'C++'
(that I can think of,) there is an almost identical
construct in Ada, though perhaps with a different
syntactical layout. Thus, converting from 'C'/C++ to Ada
involves merely rewording the text. (In fact, I have 
heard that Java is even more similar to Ada, than either
'C' or C++, so presumably this goes for Java as well)

Conversely, Ada has features, such as exception handling,
range checking, and typing, (not to mention multithreaded
tasking, protected and private types, and generics,) that
do not simply involve a straight rewording of the code. 

My guess that writing an Ada to 'C'/C++ to convertor would be
almost as difficult as writing a compiler, which is why I
have not heard of one. Not only that, but the people who
have been writing Ada compilers, while having had a shaky
start, (very shaky in the 80's) have basically cracked all
the difficult bits of the language (for Ada83 at least) which
is why Ada compilers are now more or less on par with 'C'
compilers. Starting from scratch into 'C' would take quite
some time to approach, I think, the levels of optimisation
that a straight compile of the Ada to an object file would
take. It would make sense I think, just to link in the 
object files, assuming you can, to your 'C'. (I say this
because I know it is possible with GNAT, but I am not so
sure with other compilers. Though I have not come across
an Ada compiler yet that could not link the other way.)

I think a convertor like this would provide a great many
people, a lot of fun to work on. However, it does seem
just a bit pointless. As time goes on, it shall become a 
greater and greater requirement for a language to interface
with others, bearing in mind the huge quantities of legacy 
code, (growing in size every day.)

---
Ian Ward's opinions only : wardi@rsd.bel.alcatel.be




  parent reply	other threads:[~1996-09-26  0:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-25  0:00 Ada to C/C++ translator needed Emmanuel Champommier
1996-09-25  0:00 ` David Weller
1996-10-02  0:00   ` B|rje Norden
1996-10-04  0:00     ` David Weller
1996-10-05  0:00     ` Robert Dewar
1996-10-05  0:00       ` Frank Manning
1996-10-06  0:00         ` Samuel Tardieu
1996-10-07  0:00           ` Richard Kenner
1996-10-07  0:00             ` Robert Dewar
1996-10-08  0:00             ` Stephen Leake
1996-10-07  0:00         ` Robert Dewar
1996-10-08  0:00           ` Frank Manning
1996-10-07  0:00   ` Erik Magnuson
1996-09-26  0:00 ` Ian Ward [this message]
1996-10-02  0:00   ` Jon S Anthony
1996-10-02  0:00   ` Jon S Anthony
     [not found]   ` <52feul$os2@goanna.cs.rmit.edu.au>
1996-09-28  0:00     ` Tim Behrendsen
1996-09-29  0:00       ` Ken Pizzini
1996-09-29  0:00         ` Tim Behrendsen
1996-09-29  0:00           ` Robert Dewar
1996-09-30  0:00             ` Tim Behrendsen
1996-09-30  0:00               ` Matthew Heaney
1996-09-30  0:00                 ` Tim Behrendsen
1996-09-30  0:00               ` William Clodius
1996-10-01  0:00               ` Richard A. O'Keefe
1996-09-30  0:00           ` Richard A. O'Keefe
1996-09-30  0:00             ` Tim Behrendsen
1996-09-30  0:00       ` Richard A. O'Keefe
1996-09-30  0:00         ` Tim Behrendsen
1996-09-30  0:00           ` Peter Seebach
1996-09-30  0:00             ` Tim Behrendsen
1996-10-01  0:00           ` Richard A. O'Keefe
1996-10-01  0:00             ` Tim Behrendsen
1996-10-02  0:00               ` Ian Ward
1996-10-02  0:00                 ` Tim Behrendsen
1996-09-30  0:00         ` Peter Seebach
1996-10-02  0:00           ` Richard A. O'Keefe
1996-10-05  0:00             ` Lawrence Kirby
1996-10-06  0:00     ` Tanmoy Bhattacharya
1996-10-06  0:00       ` Lawrence Kirby
1996-10-08  0:00         ` Peter Seebach
1996-10-07  0:00     ` Tanmoy Bhattacharya
  -- strict thread matches above, loose matches on Subject: below --
1996-10-02  0:00 Simon Johnston
1996-10-07  0:00 ` Richard Riehle
1996-10-09  0:00   ` Richard A. O'Keefe
1996-10-15  0:00     ` Tucker Taft
replies disabled

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