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,30352abc52760363 X-Google-Attributes: gid103376,public From: dweller@universe.digex.net (David Weller) Subject: Re: Ada to C++ Translators Date: 1998/02/18 Message-ID: <6ceq7m$3nc@universe.digex.net>#1/1 X-Deja-AN: 326221078 References: <34E47622.15EB@atc-1s.hac.com> <1998Feb13.213046.1@eisner> <6c9tjc$obg@universe.digex.net> <34eb5d36.20077308@news.tiac.net> Organization: Express Access Online Communications, Greenbelt, MD USA Newsgroups: comp.lang.ada Date: 1998-02-18T00:00:00+00:00 List-Id: In article <34eb5d36.20077308@news.tiac.net>, Jean D. Ichbiah wrote: > >[Deletia related to somebody asking for an Ada to C++ Translator] > >> Let's save Mr. Kusuda a bag of time: >> >> 1) It can be done >> 2) Over a lot of time >> 3) With a lot of money >> 4) Starting from scratch is MUCH cheaper >> 5) It's a pretty dumb thing to do anyway >> (It takes less code to do a project in Ada95 than in C++) > >Why so intolerant? Perhaps if you are asking about an automatic >translator. But hand translation is possible. A well-designed Ada >program will translate into a well-designed C++ program. (And a messy >Ada program - I have seen some horrifying examples too - will convert >into another mess.) In this context of hand translation: > >1) is certainly true. >2) is incorrect. For a well designed program, it can be done in >linear time. > >3) is wrong. >4) is wrong also: why repeat the careful analysis done in the first >place > Your four rebuttals are indeed correct for hand-translation. Of course, one could say it's a red herring, since the question was in response to _automated_ translation. >5) is an academic assertion. > Wrong. It's an unpublished _fact_. Big difference. My work with the C++ Booch Components (_hand_ translating them into Ada95) yielded around a 10% _reduction_ in overall code. It would be fair to qualify where that reduction came from: The template syntax in C++, IMHO, stands as one of computer science's most outstanding examples of abominal syntax. The necessity to repeat the signature syntax in all but the most confined circumstances stands as an eternal monument to C++'s convoluted "I'm Object-Oriented But I MUST Act Like C" motto. (Also IMHO, given what Bjarne had to work with, I don't think it could have been done with any more elegance, so this isn't a slam on his design effort). Imperative code, namespaces, exceptions, etc. generally pan out to a 1:1 basis. Ada shines in generics and usage of those generics. I'm personally starting to pine for something that combines what I feel are the best features of Ada and C++, and it AIN'T called Java! >The namespace concept helped a lot. My impression of C++ is that >it is a huge language and that you can easily get lost. But if you >start from a clean model, it is easier to restrict yourself to a >manageable subset. > I, too, work in C++ every day. Unfortunately, finding developers that can exercise "feature restraint" is a rare occurrence :-) Namespaces are nice, but most compilers still don't handle the combination of namespaces and templates very well (as well as numerous other things :-( ) -- ****** NEW!! DoD Ada Hotline Number: 1-800-PARIAH ****** Tired of "junk" e-mail? Write to your congressman and tell them you support H.R. 1748, "The Netizens Protection Act of 1997". Make those SPAM-roaches run! http://www.cauce.org TAKE BACK THE INTERNET!