comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Ada95 to ANSI_C converter
Date: 1997/04/01
Date: 1997-04-01T00:00:00+00:00	[thread overview]
Message-ID: <E7xots.51o@world.std.com> (raw)
In-Reply-To: JSA.97Mar31144058@alexandria


In article <JSA.97Mar31144058@alexandria>,
Jon S Anthony <jsa@alexandria> wrote:
>Hmmm, _fundamentally_ inefficient?  I'm not confinced.  Of course, it
>definitely will be completely unreadable.

Robert is probably alluding to the fact that C doesn't catch overflows.
Of course, one could imagine a translator that assumed the Ada program
isn't bothered by overflows...

>Well, wasn't it ICC that marketed such a thing for real work?  I'm not
>sure they'd agree with you.  In fact, I recall yourself claiming that
>there was nothing "fundamentally" wrong with the approach.

I believe ICC used various implementation-dependent tricks to catch
overflows efficiently.  And they didn't claim to produce readable C --
just correct C.

>Perhaps.  But that is irrelevant.  The specific case is whether
>Jennifer wants this approach, and it's unclear why people should
>presume what it is she really wants and then trash her for it.

Indeed.  IMHO, the correct response to the common "does there exist a
translator from language X to language Y?" question should be some
questions: Do you want any or all of (1) completely correct
implementation of language X?, (2) Do you want the generated code to be
fast?, and (3) Do you want it to be readable to regular language-Y
folks?  Perhaps also, (4) do you want the typical language-Y debugger to
make sense of it?

I have witnessed successful semi-automated translations from one
language to another, even when readability was important.  IMHO, it
helps if (1) the translator can take advantage of the idioms used by a
particular program in the source language (e.g. we don't care about
overflow, or we don't use nested procedures), (2) the source language is
higher level than the target, (3) one is willing to fiddle with the
source code, to make the target code come out reasonable, and (4) one is
willing to fiddle with the target code, after having gotten it to
"work".

Translating from good C to good Ada is nigh unto impossible.
Translating in the other direction is perhaps doable (although it tends
to cost approx the same as an Ada compiler, which is, these days, into
millions of dollars).

- Bob




  parent reply	other threads:[~1997-04-01  0:00 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5hbrah$ctt$1@gail.ripco.com>
1997-03-26  0:00 ` Ada95 to ANSI_C converter Nick Roberts
1997-03-26  0:00   ` Robert Dewar
1997-03-27  0:00     ` Jennifer E. Lee
1997-03-28  0:00       ` Craig Franck
1997-03-28  0:00         ` Robert Dewar
1997-03-28  0:00     ` Steve Doiel
1997-03-28  0:00       ` Robert Dewar
1997-04-02  0:00         ` Richard Kenner
1997-04-02  0:00           ` Robert Dewar
1997-04-02  0:00             ` Richard Kenner
1997-04-02  0:00               ` Robert Dewar
1997-04-02  0:00             ` Robert A Duff
1997-04-04  0:00               ` Keith Thompson
1997-04-04  0:00                 ` Robert Dewar
1997-04-07  0:00                   ` Arthur Schwarz
1997-04-07  0:00                     ` Peter Seebach
1997-04-07  0:00                       ` Kaz Kylheku
1997-04-07  0:00                     ` Robert Dewar
1997-04-08  0:00                       ` Robert A Duff
1997-04-08  0:00                   ` Keith Thompson
1997-04-02  0:00       ` Richard Kenner
1997-04-03  0:00         ` Fergus Henderson
1997-03-27  0:00   ` Craig Franck
1997-03-27  0:00     ` Jennifer E. Lee
1997-03-27  0:00   ` Jennifer E. Lee
1997-03-27  0:00     ` Philip Johnson
1997-04-01  0:00       ` Jennifer E. Lee
1997-04-02  0:00         ` Philip E. Johnson
1997-04-03  0:00       ` Jon S Anthony
1997-03-28  0:00     ` Robert Dewar
1997-03-28  0:00       ` Craig Franck
1997-03-28  0:00         ` Robert Dewar
1997-04-01  0:00     ` David Kristola
1997-04-01  0:00       ` Jennifer E. Lee
1997-04-01  0:00     ` Tom Wheeley
1997-04-01  0:00   ` Robert I. Eachus
1997-03-27  0:00 ` Jeff Carter
1997-03-28  0:00 ` Jon S Anthony
1997-03-28  0:00   ` Robert Dewar
1997-04-02  0:00   ` Jon S Anthony
1997-04-03  0:00     ` Robert Dewar
1997-04-04  0:00     ` Jon S Anthony
1997-04-03  0:00   ` Jon S Anthony
1997-04-03  0:00     ` Robert A Duff
1997-04-03  0:00       ` Robert Dewar
1997-04-03  0:00     ` Robert Dewar
1997-04-04  0:00   ` Jon S Anthony
1997-04-04  0:00     ` Robert Dewar
1997-04-04  0:00     ` Robert Dewar
1997-04-07  0:00   ` Jon S Anthony
1997-04-07  0:00   ` Jon S Anthony
1997-03-28  0:00 ` Jon S Anthony
1997-03-31  0:00 ` Jon S Anthony
1997-03-31  0:00   ` Robert Dewar
1997-04-01  0:00   ` Robert A Duff [this message]
1997-03-31  0:00 ` David Emery
1997-04-03  0:00 ` Jon S Anthony
1997-04-03  0:00   ` Jennifer E. Lee
1997-04-04  0:00 ` Howard W. LUDWIG
1997-04-16  0:00 Dan Lehman
1997-04-17  0:00 ` Robert Dewar
1997-04-20  0:00   ` Nick Roberts
1997-04-20  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