Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!umd5!uflorida!novavax!hcx1!hcx9!brucej
From: brucej@hcx9.SSD.HARRIS.COM
Newsgroups: comp.lang.ada
Subject: Re: Conditional compilation
Message-ID: <94700004@hcx9>
Date: 29 Jun 88 13:32:00 GMT
References: <28254@clyde.ATT.COM>
Lines: 39
Nf-ID: #R:clyde.ATT.COM:28254:hcx9:94700004:000:1900
Nf-From: hcx9.SSD.HARRIS.COM!brucej    Jun 29 09:32:00 1988


djs@actnyc.UUCP states several objections to embedding conditional
compliation within an Ada compiler:

> I don't like the pragma approach as it is very hard to specify it within
> the bounds of pragma legality.  [RM references & explanation deleted]

> Additionally, a significant conditional compilation facility requires a
> meta-language of its own for definition and evaluation of conditions upon
> which to include text into a compilation or not. [more deletions]

> I am in favor of a distinct facility in the programming environment, like
> a preprocessor, for doing file inclusion, conditional compilation, and
> the like. Go ahead and standardize it, but don't force it into the Ada
> compiler. 

Here at Harris, we discovered a need for conditional compilation when
we first attempted to rehost and retarget the toolset we ship with our
Ada compiler.  Our approach was to create a preprocessor to perform 
that conditional compilation, and to implement code in the compiler
to automatically invoke the preprocessor as needed.  Ada source files
have a `.a' suffix,  while files in need of preprocessing have a `.pp'
suffix.  If the compiler's input file ends in `.pp' it first invokes
the preprocessor ("a.pp foo.a"), and then compiles the `.a' file.

Preprocessing as a separate pass is cheap and efficient.  Invoking an
expensive global optimizer to perform this function is overkill.  Besides,
the optimizer has more than enough to do anyways.

While it would be presumptuous of me to propose that Harris' preprocessor
syntax be standardized,  I can at least point out the preprocessor's great 
value in allowing us to use a common set of source code for our Ada toolset 
for all of our different host/target combinations.  We found a.pp so useful
that we released it as part of our toolset.

----------
Bruce Jones 
brucej@hcx1.harris.com
Harris Computers, Fort Lauderdale, FL