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: 103376,76da32d8c4934801 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Ada --> C Translation, was: Win CE target Date: 1998/09/29 Message-ID: #1/1 X-Deja-AN: 395804262 Sender: bobduff@world.std.com (Robert A Duff) References: <3604A4C6.8C4@erols.com> <6u65h0$f1b$1@nnrp1.dejanews.com> <6u6flv$qn7$1@nnrp1.dejanews.com> <360FB3B0.5B0E218C@galileo.mpi-hd.mpg.de> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-09-29T00:00:00+00:00 List-Id: Stefan Helfert writes: > dewarr@my-dejanews.com wrote: > [...] > > Some of the trouble areas in compiling into C are > > > > 1. Arithmetic overflow checks, especially in complex > > expressions, which have to be broken down into steps > > or written in prefix notation. > > > > 2. Nested procedures, and particularly nested procedures > > with complex local declarations. > > > > 3. Subunits (hard to do anything other than create a huge > > source in which the subunits are substituted). > > > > 4. Exceptions > > > [...] > > I will say for the record, that, according to MY definition > > of readability, it is not possible to translate Ada 95 into > > readable C in all cases. What's YOUR definition of "readability"? A master C programmer doesn't have access to any of the features mentioned above (eg nested procedures), either. So of COURSE a program that could benefit from nested procedures will be more readable in Ada than in C (eg maybe the C code will have to pass extra bogus parameters, or whatever). Of course an automatic translator can't use nested procedures either. Or subunits. Or tasks. Or whatever. But, given an automatic translator from Ada to C, one ought to measure the readability of the translator output with respect to hand-written C code. Given that the hand-written C code can't do (say) exceptions in any direct way, why should one complain when the output of the Ada-to-C translator can't do it directly? In other words, we shouldn't complain if the generated C code is less readable than the Ada code; we should only complain if the generated C code is less readable than typical hand-written C code. - Bob -- Change robert to bob to get my real email address. Sorry.