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,355f90547d1b4b5 X-Google-Attributes: gid103376,public From: Rakesh Malhotra Subject: Re: PRECOMPILATION Date: 1999/02/18 Message-ID: <7aickf$pb4$1@news-1.news.gte.net>#1/1 X-Deja-AN: 445901578 Content-Transfer-Encoding: 7bit References: <918556681.260459@dedale.pandemonium.fr> <36C0B5D4.DEF83A66@averstar.com> <7ahor8$otv@news1.newsguy.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: gte.net X-Auth: UNKNOWN@192.78.246.23 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-18T00:00:00+00:00 List-Id: Samuel Mize wrote: > > Tucker Taft wrote: > You'll have to provide > some higher-level package that interacts with the system, instead > of just embedding code to do low-level system things throughout > your program.... > > C-experienced people probably expect platform-specific issues to be > shot through the whole program, like cancer. ... >... [snipped] > So they fear the spectre of having to maintain parallel files for > a huge number of units, and getting their logic out of synch. > ... [snipped] > This is greatly reduced by using Ada's strong typing and separate > compilation capabilities. Once you've set up a fairly small > platform interface, all the rest of the source code is invariant. > But it takes a bit of experience to really believe that. > ... [snipped] > Again, Ada largely takes care of this concern. If you missed an > element that you need in one of your platform-specific files, the > program won't compile. It's actually easier to maintain most > cross-platform dependencies in Ada, once you adapt your design to > the Ada mindset. > Thanks for the enlightening explanation above. I have not done any cross-platform coding in C or Ada but have often wondered how one would do the equivalent of the C preprocessor stuff in Ada. I have ported bought-in 3rd party libraries written in C to my platform (e.g. a TCP/IP library for an embedded platform). You are correct in saying that the cross-platform stuff (e.g. size of a variable) is shot through the whole program and it makes reading the code quite difficult. In the libraries I bought it was quite a nightmare till, after staring at the code for a couple of weeks, I started to understand all the dependencies. Would it be possible to give an Ada example of how you would do what you have suggested in your message above ? i.e. what kind of things does one put into the platform specific packages, does one not land up with having to maintain many such packages versus just 1 file in the C case etc ? Some code that highlights your explanation will help. Thanks Rakesh