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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47327673b9e29af0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-03 08:16:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!wn3feed!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail Message-ID: <3D2315CA.7050807@attbi.com> From: "Robert I. Eachus" Organization: Eachus Associates User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada -> C or C++ translator References: <3D0DD57A.5000402@yahoo.com> <3d0dda3d$1@pull.gecm.com> <3D0DDD18.7090501@yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.61.239.24 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1025709379 24.61.239.24 (Wed, 03 Jul 2002 15:16:19 GMT) NNTP-Posting-Date: Wed, 03 Jul 2002 15:16:19 GMT Date: Wed, 03 Jul 2002 15:16:19 GMT Xref: archiver1.google.com comp.lang.ada:26847 Date: 2002-07-03T15:16:19+00:00 List-Id: pontius@btv.mbi.com.invalid wrote: > Picture an area where C/C++ are the normal and supported tools, and > indeed there is an aversion to "weird" stuff like Ada. Even within a > company or area things like this can vary from one department to > another. > > So at the moment, while I may prefer to do some development in Ada, I > am being told to "just use normal stuff that someone else can pick up > from you, instead of something weird that will make us write it over." > Keep in mind that software development is also not our main job, rather > something that sometimes needs to be done so we can do our main job. > > So I'd like to develop in Ada, and be prepared as needed to move the > code to C/C++, or perhaps Java, if it needs to be given to someone > else. Since there is no support, and hence no budget for this idea, I > need to use free tools. Interface to existing C/C++ libraries is also > necessary. (former easy, latter may need workarounds) > > So far since the code hasn't been terribly performance sensitive, I've > been using scripting languages so far. I may be able to keep it there, > but I don't know. There was a project many years ago that had us all laughing when we found out what was going on. You could probably use the same technique... The project manager and all of his team wanted to use Ada, but alas upper management would not let them. The code had to be in C so it would be portable. What did they do? Well they defined a number of C macros, then wrote all their code in (a subset of) Ada. Add an emacs macro which added the #defines and changed withs into includes, and they were all set. The project code was all written in Ada, but the check-in process compiled the C code as well, and the CM suite also checked overnight that the C and Ada versions produced identical output on the regression suite. Sounds like a lot of work, but it took less than a week to get the first version of the toolset up and running. In fact it took some of the programmers longer to understand that if the Ada compile failed, there really was a bug in their code. The biggest complaints of course were about things that were valid in K&R C and some current C compilers "let you get away with." For example, returning -1 from a function defined to return a pointer... In general the programming team felt that the "up front" cost through unit test balanced out. Getting clean initial clean compiles from both Ada and C took longer, but that was more than cancelled out by the strong typing benefits when interfaces needed to be modified. Of course, integration and test was scheduled for 8 months, and took three weeks. ;-) I know it sounds hard, but once they got started, the #defines were easy: #define begin { #define end } \/\/ (Did I get that right? It has been so long since I did "clever" things in cpp. The intent of course is to make everything following the end keyword a comment.) And of course, there were areas of Ada that they had no intention of using such as tasking and exceptions, so those were not supported by the translation too.