comp.lang.ada
 help / color / mirror / Atom feed
* RE: C to Ada translators
@ 1988-07-02 19:22 Mike Linnig
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Linnig @ 1988-07-02 19:22 UTC (permalink / raw)


> From: astroatc!philm@speedy.cs.wisc.edu  (Phil Mason)
> Subject: WANTED : DEAD OR ALIVE - "C" to ADA Translator
> 
> I have an important application for a "C" to ADA Translator.  It doesn't even
> have to translate all "C" constructs or strange pointer operations.  
> I thought I saw one on the net within the last two years.  Was I dreaming??
> Any help would be most appreciated.
> Commericial/Public Domain/Shareware solutions welcome.
> - - - Philm

Good luck in finding a freebie translator.  The only way I know to
go from C to Ada is to call up Lexeme. They claim to do such translation
as a service.. for big bucks.

They claim 100% translation.  The supposedly use AI techniques to do the
translation.  The will translate from Fortran, Cobol, PL/1, and Basic (!)
to C and Ada.

I seem to remember that the charge something like $2 per line!!   I suppose
this might be cost effective if you had a large system to convert and the
only other option is re-writing it from scratch.  They were written up in
the September 23, 1985 issue of ELECTRONICS (with rave reviews).

				  Their address is:

				  LEXEME CORPORATION
				  Suite 250, Commerce Court
				  Four Station Square
				  Pittsburgh, PA 15219-1119


Good luck,

	Mike Linnig,
	Texas Instruments

^ permalink raw reply	[flat|nested] 15+ messages in thread

* C to ADA translators.
@ 1993-04-05 21:12 Pat
  1993-04-06 12:16 ` Brad Wallet
  0 siblings, 1 reply; 15+ messages in thread
From: Pat @ 1993-04-05 21:12 UTC (permalink / raw)




I am looking for a program that will take a fairly clean
C program  and convert it to ADA.  Does anyone know?


thanks





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
  1993-04-05 21:12 Pat
@ 1993-04-06 12:16 ` Brad Wallet
  0 siblings, 0 replies; 15+ messages in thread
From: Brad Wallet @ 1993-04-06 12:16 UTC (permalink / raw)


In article <1pq7be$pb6@access.digex.net>, prb@access.digex.com (Pat) writes:
|> 
|> 
|> I am looking for a program that will take a fairly clean
|> C program  and convert it to ADA.  Does anyone know?
|> 
|> 
|> thanks
|> 
|> 

And we wonder why Ada projects overrun!  Design and write the code
in Ada.  I rarely post, and almost never flame anyone, but i am sick
and tired of contractors writing the code in Fortran (C is a new
twist on this one) and then running it through a translator.  The
code that will come out will be hopelessly unmanageable, unreadable,
and unmaintainable.  I would ask you to post your company so I could
avoid dealing with it, but, unfortunately, you are far from alone.

Sorry, I guess that was a bit harsh.  I am just sick of this whole
practice.  It may (MAY) meet the letter of the law, but it doesn't
meet the spirit.  It is pure incompetence to do this.

Brad

p.s.  This are definitely my opinions.  I don't know how the Navy
feels---I am a technical type, not a manager.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-06 18:41 Wes Groleau X7574
  0 siblings, 0 replies; 15+ messages in thread
From: Wes Groleau X7574 @ 1993-04-06 18:41 UTC (permalink / raw)


In article <1993Apr6.121615.7936@relay.nswc.navy.mil> bwallet@apssgi.nswc.navy.
mil (Brad Wallet) writes:
>In article <1pq7be$pb6@access.digex.net>, prb@access.digex.com (Pat) writes:
>|> I am looking for a program that will take a fairly clean
>|> C program  and convert it to ADA.  Does anyone know?
>
>And we wonder why Ada projects overrun!  Design and write the code
>in Ada.  I rarely post, and almost never flame anyone, but i am sick
>and tired of contractors writing the code in Fortran (C is a new
>twist on this one) and then running it through a translator.  The
>code that will come out will be hopelessly unmanageable, unreadable,
>and unmaintainable.  I would ask you to post your company so I could
>avoid dealing with it, but, unfortunately, you are far from alone.
>
>Sorry, I guess that was a bit harsh.  .........

Yes, that is harsh.  The practice you flamed is indeed "not good".  But
consider other possibilities:

1. I found some free code in C that meets 95% of my requirements.  I want
to translate to Ada so that I have some hope of meeting the other 5% by my
deadline.  (I was able to make a nice low bid because I knew about this code.)

2. My (non-programmer) systems engineers (in our company, those are the guys
that write the specs and can't distinguish between requirements and 
implementation) want me to incorporate the 16-Kilbyte FORTRAN simulation they
used to develop the spec into the test support software.  Management is not
sympathetic to my desire to re-design something that "already works"

One of the alleged goals of Ada is to promote re-use.  Well, the tons of 
FORTRAN and C that are "out there" provide an excellent opportunity!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-06 19:43 agate!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!dtix.dt.navy.mil!relay-wo!relay!apssgi.nswc.navy.mil!bwallet
  0 siblings, 0 replies; 15+ messages in thread
From: agate!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!dtix.dt.navy.mil!relay-wo!relay!apssgi.nswc.navy.mil!bwallet @ 1993-04-06 19:43 UTC (permalink / raw)


In article <C52rx3.B67@crdnns.crd.ge.com>, groleau@e7sa.crd.ge.com (Wes Groleau
 X7574) writes:
|> 1. I found some free code in C that meets 95% of my requirements.  I want
|> to translate to Ada so that I have some hope of meeting the other 5% by my
|> deadline.  (I was able to make a nice low bid because I knew about this code
.)

Yep, that's what I am talking about.  Short cut to a quick profit produces
an unmaintainable system.  How bad do you want it?  That's how bad your
going to get it.

brad

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-06 19:45 Dave Bashford
  0 siblings, 0 replies; 15+ messages in thread
From: Dave Bashford @ 1993-04-06 19:45 UTC (permalink / raw)


In article <1993Apr6.121615.7936@relay.nswc.navy.mil> bwallet@apssgi.nswc.navy.
mil (Brad Wallet) writes:
>In article <1pq7be$pb6@access.digex.net>, prb@access.digex.com (Pat) writes:
>|> 
>|> I am looking for a program that will take a fairly clean
>|> C program  and convert it to ADA.  Does anyone know?
>
>And we wonder why Ada projects overrun!  Design and write the code
>in Ada.  I rarely post, and almost never flame anyone, but i am sick
>and tired of contractors writing the code in Fortran (C is a new
>twist on this one) and then running it through a translator.  The
>code that will come out will be hopelessly unmanageable, unreadable,
>and unmaintainable.  I would ask you to post your company so I could
>avoid dealing with it, but, unfortunately, you are far from alone.
>
>Sorry, I guess that was a bit harsh.  I am just sick of this whole
>practice.  It may (MAY) meet the letter of the law, but it doesn't
>meet the spirit.  It is pure incompetence to do this.
>
>Brad
>

Since religion seems to be an acceptable thread in this group, I'll bite.

If I have a piece of software that has already been written, tested, and
used in other applications - but was not written in Ada. Or I have a COTS
product that generates code in a language other than Ada, and I can't
convince the vendor to change the product with the budget and schedule I'm
working under. And I have a customer who requires "the letter of the law"
with a limited budget and schedule.

What would you have me do ?

One solution I've heard of: Get a waiver for assembly and compile the C
to assembly. Much easier than getting a waiver for C. There's your "letter
of the law".
-- 

db
bashford@srs.loral.com (Dave Bashford, Sunnyvale, CA)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-06 21:27 timothy shimeall
  0 siblings, 0 replies; 15+ messages in thread
From: timothy shimeall @ 1993-04-06 21:27 UTC (permalink / raw)


In article <C52rx3.B67@crdnns.crd.ge.com> groleau@e7sa.crd.ge.com (Wes Groleau 
X7574) writes:
>1. I found some free code in C that meets 95% of my requirements.  I want
>to translate to Ada so that I have some hope of meeting the other 5% by my
>deadline.  (I was able to make a nice low bid because I knew about this code.)

You miss the point of the objection.  
First, you are assuming that a mechanical translation from C to Ada
would produce a reliable program written in Ada from a reliable
program written in C.   This is debatable, given the ambiguity
of several of the common idioms used in C code.
For example, it is quite possible that the correct
interpretation of the c declaration:
   void dosomething(a)
   int ***a;
would be the Ada declaration:
   procedure dosomething(a:in out int_ptr_array) is ...
(in other words, the first * in the C declaration indicates an
 in out parameter, the second * indicates the parameter is an
  array, and the third * indicates the array holds pointers.)
but how would you design a software system to disambiguate this
from the OTHER possible interpretations of int ***a?

To get around this (and many other, similar) problem, you need a 
complete review of the generated Ada code by someone who thoroughly 
understands the C code being translated, the rules used to translate it, and
the proper Ada translations -- I submit (from experience in trying
mechanical translations) that this review will be more expensive,
and slower, than reverse-engineering the "free code" and rewriting it from
scratch.

Second, you assume that your customer wanted the code in Ada because
of some mystical belief in Ada.  This is probably false.  He wanted it
in Ada because he didn't want to have to support multiple language
compilers and multiple language training for the duration of the
system lifespan.  In short -- He wanted the system in Ada to simplify
maintenance.  A mechanically-translated piece of software is likely to
be unmaintainable, unless you do a LOT of reworking and commentary. So
you deliver an unmaintainable system and your company loses reputation.

>2. My (non-programmer) systems engineers (in our company, those are the guys
>that write the specs and can't distinguish between requirements and 
>implementation) want me to incorporate the 16-Kilbyte FORTRAN simulation they
>used to develop the spec into the test support software.  Management is not
>sympathetic to my desire to re-design something that "already works"

Point out to the systems engineers that you cannot guarantee that the
mechanically-translated simulation will produce the results the FORTRAN
simulation produced, whereas a redesigned simulation might (if done 
properly) be so guaranteed.  If they want you to incorporate the unverified
simulation anyway, go ahead and do it, but ask for the instruction in
writing... 

If you want to go with some sort of translation, look into DRACO or
similar efforts that abstract the DESIGN from an implementation in 
the source language and then refine the design into the target
language.  But be warned, such tools are a) difficult to find and
b) require effort to use.
				Tim
P.S. Note, while I'm writing from a Navy cite, I'm not a spokesperson
for the Navy, nor should any of the above statements be considered 
policy statements of any organization.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-06 23:25 David Emery
  0 siblings, 0 replies; 15+ messages in thread
From: David Emery @ 1993-04-06 23:25 UTC (permalink / raw)


If it's in C or FORTRAN, leave it there.  That's what PRAGMA INTERFACE
is for.
			dave

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-07 17:22 Wes Groleau X7574
  0 siblings, 0 replies; 15+ messages in thread
From: Wes Groleau X7574 @ 1993-04-07 17:22 UTC (permalink / raw)


In article <1993Apr6.194350.12118@relay.nswc.navy.mil> bwallet@apssgi.nswc.navy
.mil (Brad Wallet) writes:
>In article <C52rx3.B67@crdnns.crd.ge.com>, groleau@e7sa.crd.ge.com (Wes Grolea
u X7574) writes:
>|> 1. I found some free code in C that meets 95% of my requirements.  I want
>|> to translate to Ada so that I have some hope of meeting the other 5% by my
>|> deadline.  (I was able to make a nice low bid because I knew about this cod
e.)
>
>Yep, that's what I am talking about.  Short cut to a quick profit produces
>an unmaintainable system.  How bad do you want it?  That's how bad your
>going to get it.

No, the shortest cut to a quick profit is to leave it in C and re-write the
requirements to eliminate the 5%.  Converting to Ada is the first step in
making the stuff maintainable.  If the resulting Ada is a mess, then the
sensible thing to do is start over and use Ada (unless it's throwaway code
anyway).  Besides, not all C code is unmaintainable ( just most of it :-) )
C programmers may control the market for garbage, but there's still plenty
of Ada programmers making a living at it.  Good software engineering is
possible in any language (even BASIC).  The fact that it is rare in certain
languages does not justify a blanket ban on looking at code written in 
those languages.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-07 18:26 Alex Blakemore
  0 siblings, 0 replies; 15+ messages in thread
From: Alex Blakemore @ 1993-04-07 18:26 UTC (permalink / raw)


In article <C52rx3.B67@crdnns.crd.ge.com> groleau@e7sa.crd.ge.com (Wes Groleau 
X7574) writes:
> 1. I found some free code in C that meets 95% of my requirements.  I want
> to translate to Ada so that I have some hope of meeting the other 5% by my de
adline.

> One of the alleged goals of Ada is to promote re-use.  Well, the tons of 
> FORTRAN and C that are "out there" provide an excellent opportunity!

fine, but before you mechanically try to translate the software to Ada,
why not try to build an Ada binding to the C or FORTRAN code,
(.i.e. RTFM about pragma interface and friends)

this is a lot cheaper and safer than translating and often works well.
You can, with some care, make the binding provide some type safety and
a nice abstract interface with exceptions, decent names etc and hide
all the nasty conversion stuff in the package body of the binding.

its not always portable, but the problems can be restricted to the
binding body.

there is a tool on sgi.com called c2ada which translates C header
files to Ada specs, expect to do some work afterwards, but this can
help build a binding faster.

there are times when this wont meet your needs, but I'ld sure spending
a little time trying to get a binding to work before translating the
whole thing.  If you have to resort to translation, much of the
binding work will still be useful.

if the mandate is the problem, I think there is an exclusion allowed
for new code versus existing code.  If you can certify the existing
code, as not changing by xx% and separate that from the new code that
you must write in Ada then you may be able to get by.  of course, then
your contract officer will be aware what they are buying (which may
already be free) and then should be able to decide what he wants.

-- 
---------------------------------------------------
Alex Blakemore alex@cs.umd.edu   NeXT mail accepted

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-07 18:27 howland.reston.ans.net!usc!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mkso
  0 siblings, 0 replies; 15+ messages in thread
From: howland.reston.ans.net!usc!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mkso @ 1993-04-07 18:27 UTC (permalink / raw)


In <1993Apr6.194350.12118@relay.nswc.navy.mil> bwallet@apssgi.nswc.navy.mil (Br
ad Wallet) writes:

>In article <C52rx3.B67@crdnns.crd.ge.com>, groleau@e7sa.crd.ge.com (Wes Grolea
u X7574) writes:
>|> 1. I found some free code in C that meets 95% of my requirements.  I want
>|> to translate to Ada so that I have some hope of meeting the other 5% by my
>|> deadline.  (I was able to make a nice low bid because I knew about this cod
e.)

>Yep, that's what I am talking about.  Short cut to a quick profit produces
>an unmaintainable system.  How bad do you want it?  That's how bad your
>going to get it.

As far as I'm concerned, the solution in the specific case mentioned
would seem to be to get a waiver and do the remaining 5% in C.  How is
Wes going to do code walkthroughs on the (translated) Ada, which is
going to be virtually unreadable?

Unfortunately, this is one of those things that a 'mandate' promotes.

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-07 19:24 agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!darwin.sura.net!sg
  0 siblings, 0 replies; 15+ messages in thread
From: agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!darwin.sura.net!sg @ 1993-04-07 19:24 UTC (permalink / raw)


In <66126@mimsy.umd.edu> alex@cs.umd.edu (Alex Blakemore) writes:

>fine, but before you mechanically try to translate the software to Ada,
>why not try to build an Ada binding to the C or FORTRAN code,
>(.i.e. RTFM about pragma interface and friends)

Once again, let me gently point out that those of us used to BSD
environments do things much more simply when we need to make major
applications communicate with one another.  We invoke each as a separate
process, and we let them communicate via messages (usually through
'pipes', often through intermediate files when the communication is
batch-oriented).

For a small and clean example of this, look at the 'cterm' package
written in C, which allows any program written using perl to uses
screen management routines.  The perl process communicates with the
cterm process via a bidrectional pipe.

Monolithicity for the sake of monolithicity, i.e., assuming that the
only way of combining two software modules is to link them together and
make one big mass out of them, is a bad idea.  Although it's true that
Ada was primarily designed for embedded systems, my guess is 95% of the
Ada code out there implements conventional applications that the rest
of us happily write in C, Fortran, or Cobol, without having any special
requirements to interface with specific hardware.  It's such
applications that are best implemented as relatively self-contained
modules each running as a separate process in the BSD style.  Given
such a paradigm, there is no need to convert existing C code into Ada,
or even link it with an Ada program.  Just give it a convenient
interface and let it run as a separate process.
-- 
Rahul Dhesi <dhesi@rahul.net>
also:  dhesi@cirrus.com

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-07 20:33 Wes Groleau X7574
  0 siblings, 0 replies; 15+ messages in thread
From: Wes Groleau X7574 @ 1993-04-07 20:33 UTC (permalink / raw)


In article <1993Apr7.182705.1887@mksol.dseg.ti.com> mccall@mksol.dseg.ti.com (f
red j mccall 575-3539) writes:
>As far as I'm concerned, the solution in the specific case mentioned
>would seem to be to get a waiver and do the remaining 5% in C.  How is
>Wes going to do code walkthroughs on the (translated) Ada, which is
>going to be virtually unreadable?

If it's unreadable, then the C couldn't have been much better.  If it was that
bad, I would have chosen to re-code in Ada rather than translate.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: C to ADA translators.
@ 1993-04-08 17:06 fred j mccall 575-3539
  0 siblings, 0 replies; 15+ messages in thread
From: fred j mccall 575-3539 @ 1993-04-08 17:06 UTC (permalink / raw)


In <C54rsC.1us@crdnns.crd.ge.com> groleau@e7sa.crd.ge.com (Wes Groleau X7574) w
rites:

>In article <1993Apr7.182705.1887@mksol.dseg.ti.com> mccall@mksol.dseg.ti.com (
fred j mccall 575-3539) writes:
>>As far as I'm concerned, the solution in the specific case mentioned
>>would seem to be to get a waiver and do the remaining 5% in C.  How is
>>Wes going to do code walkthroughs on the (translated) Ada, which is
>>going to be virtually unreadable?

>If it's unreadable, then the C couldn't have been much better.  If it was that
>bad, I would have chosen to re-code in Ada rather than translate.

You expect a mechanically produced translation from one language to
another to produce readable code?  You obviously don't have much
experience in this realm.  The mechanically produced translation need
bear *NO* resemblance to the original code, which could be quite
readable and maintainable.

If you're that hot for stupid language wars, please take it to
alt.flame or somewhere similar so it won't bother people who don't do
their thinking between their shins and their thighs.

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* C to Ada Translators
@ 1996-06-19  0:00 Greg Kramer
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Kramer @ 1996-06-19  0:00 UTC (permalink / raw)



Does anyone have any experience with C or C++ to Ada Translators?
Who makes them and do they work?

Thanks




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~1996-06-19  0:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-04-08 17:06 C to ADA translators fred j mccall 575-3539
  -- strict thread matches above, loose matches on Subject: below --
1996-06-19  0:00 C to Ada Translators Greg Kramer
1993-04-07 20:33 C to ADA translators Wes Groleau X7574
1993-04-07 19:24 agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!darwin.sura.net!sg
1993-04-07 18:27 howland.reston.ans.net!usc!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mkso
1993-04-07 18:26 Alex Blakemore
1993-04-07 17:22 Wes Groleau X7574
1993-04-06 23:25 David Emery
1993-04-06 21:27 timothy shimeall
1993-04-06 19:45 Dave Bashford
1993-04-06 19:43 agate!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!dtix.dt.navy.mil!relay-wo!relay!apssgi.nswc.navy.mil!bwallet
1993-04-06 18:41 Wes Groleau X7574
1993-04-05 21:12 Pat
1993-04-06 12:16 ` Brad Wallet
1988-07-02 19:22 C to Ada translators Mike Linnig

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