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: Stefan Helfert Subject: Re: Ada --> C Translation, was: Win CE target Date: 1998/09/28 Message-ID: <360FB3B0.5B0E218C@galileo.mpi-hd.mpg.de>#1/1 X-Deja-AN: 395666194 Content-Transfer-Encoding: 7bit References: <3604A4C6.8C4@erols.com> <6u65h0$f1b$1@nnrp1.dejanews.com> <6u6flv$qn7$1@nnrp1.dejanews.com> X-Accept-Language: de Content-Type: text/plain; charset=us-ascii Organization: Max-Plank-Institut fuer Kernphysik Heidelberg Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-09-28T00:00:00+00:00 List-Id: 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. Clearly this is a statement that you cannot argue with. But I am tempted to add that the C preprocessor features clearly help to add readability to a certain degree. One of my projects some time ago was a ML2C-translator, where we wanted to preserve "style" (not only readability). Now ML covers, as you may know, most of the language features that Ada sports (especially those mentioned above) and adds more (famous: garbage collection). And ML as a functional language is relying on a different programming paradigm. The C preprocessor did really help a lot: E.g., you can implement exceptions with setjmp/longjmp and hide this before the users' eyes, or hide the interface to the garbage collector/memory management. Stefan Helfert