From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,c0f035b936128b6c X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,c0f035b936128b6c X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada95 to ANSI_C converter Date: 1997/04/01 Message-ID: #1/1 X-Deja-AN: 229761935 References: <5hbrah$ctt$1@gail.ripco.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada,comp.lang.c Date: 1997-04-01T00:00:00+00:00 List-Id: In article , Jon S Anthony 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