[comp.lang.ada] Ada to C conversion

adamb@helios.enst.fr (Adam Beguelin) (10/12/90)

We have a large Ada program which we need to translate into C in order
to implement it on TMS (a digital signal processing chip).  Are there
any cross compilers that would do this automatically or does anyone
have any experience with translating Ada to C that would be helpful?

	Thanks in advance,
	Adam


	Email: adamb@inf.enst.fr
	Office: (1) 4581 7881
	Home:   (1) 4581 7138 
	Post:
	Adam Beguelin
	212 rue de Tolbiac Ch. 420
	75013 Paris France
	

stt@inmet.inmet.com (10/29/90)

Re: Ada to C translation

Meridian Software's Ada compiler has a "back end" which
can generate C, rather than machine code for the target.
This allows them to "retarget" to new targets quite
quickly, presuming the target has an existing C compiler.
I believe that their current Sun-4 compiler uses this
technology.  Meridian Software is located in Irvine, CA.

T. Taft
Intermetrics, Inc.

rgc@raybed2.msd.ray.com (RICK CARLE) (11/01/90)

In article <20600069@inmet>, stt@inmet.inmet.com writes:
> Re: Ada to C translation
> Meridian Software's Ada compiler has a "back end" which
> can generate C, rather than machine code for the target.

Don't Irvine Compiler Corp. cross-compilers also generate C?
Are ICC and Meridian somehow connected?  Are they both children of
UCal/Irvine?
	Rick Carle

jsweet@ICS.UCI.EDU (Jerry Sweet) (11/02/90)

Rick Carle asked if Irvine Compiler Corp. cross-compilers also generate C.

The answer is: in some configurations.  They also have native code
generators for several targets, most notably the Intel 80960 and the
Motorola 68000 families.

> Are ICC and Meridian somehow connected?

The answer is: not really, at least not since 1983.  Some of their
compiler components share common (internally produced) ancestors, but
the components have long since diverged.

> Are they both children of UCal/Irvine?

The answer is: yes, ca. 1981.  The founders of both companies were
students at UCI with direct or indirect connections to Tim Standish's
Ada environment project, and to Dave Farber's distributed computing
project.

The real answer to the question regarding Ada to C is that you need to
be a little bit careful about what you ask for and what you get.

Both Meridian's and ICC's Ada compilers, in some configurations,
produce C code, but the C code tends to be tailored for a specific
machine/OS configuration (i.e. it's not necessarily rehostable C
code).  Also, up until about a year or so ago, the C back ends to both
the Meridian and ICC compilers generated code that was "high-level
assembly language."  For example, local variables became index
references into a large local array, loop statements translated into
test/goto sequences, and so on.  (This is public knowledge, at least
to anyone who took the trouble to look at what the back end produced.)

About a year ago, Meridian put some serious work into at least one
configuration of their C back end (which they call "C pass 2") to
produce a higher-level Ada to C translation.  This permitted some C
compilers to do a better job of optimization.  I believe that the
higher-level C approaches acceptability to humans, although this needs
to be verified by anyone who's seen a recent edition of a C pass 2
configuration. (Anyone have it on a {Sta,A}rdent P2/P3 machine?  How
about a Multiflow?)

I don't know whether ICC did something similar or not.  In any event,
there's no harm in asking them.

Hope this helps.  By the way, my knowledge of this subject is dated as
of last March.  If anyone else knows anything more recent about the
subject, please speak up.