Re: Standard Ada Preprocessor (Was: why ada is so unpopular ?)

From: Robert I. Eachus (rieachus_at_comcast.net)
Date: 01/24/04


Date: Sat, 24 Jan 2004 10:32:35 -0500

Marin David Condic wrote:

> Since different compilers often support (or don't support) different
> declarations, I'd like some way of saying "If I'm on Gnat - compile this
> declaration - if on Aonix, make this the declaration...". I don't know
> how that can happen at runtime. Likewise, when withing packages that may
> be compiler dependent and using statements from them, I'd like some way
> of doing that and I can't imagine how a procedure call of something that
> doesn't get withed is going to sneak past the compiler and get resolved
> at runtime.

Now I see why you worry about about illegal code and I don't. As far as
I am concerned, ANYTHING I can do to minimize differences between
versions is worth the effort. That certainly includes building
wrappers. So in the Ada 83 days when different compilers had different
names for the trancendental math packages, I had MY standard. (Usually
kept updated based on the latest NUMWG work, but that is a detail.)
Similarly, I had my package that did command line arguments, with
different bodies for Alsys and Verdix, etc. So I kept a collection of
'standard' packages needed for portability. If I needed to deal with
say, a bug in Solaris, I did it there.

The net result was one directory of implementation dependent packages,
with multiple implementations, and applications that were completely
implementation independent. I kept the package specifications for the
implementation dependent stuff identical, if necessary by making the
bindings thicker than might otherwise be needed. The only case where I
can ever remember a problem, Rational called me about one of my ADAR
packages that didn't compile due to an Unchecked_Conversion.

Rational didn't allow Unchecked_Conversions of access types. In
addition to telling them a work around, I suggested that they treat this
case as as a compiler bug. It involved an Unchecked_Conversion of an
object of an access type to the same access type. (Why did I do it? It
allowed me to put a with clause on a body instead of on the package
specification.)

-- 
                                           Robert I. Eachus
"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush


Relevant Pages

  • Re: Manifesto against Vector
    ... >> Well, call me old school or so, but most of the times the only IDE I ... It tells me, what I am using, it tells the compiler what I am going to ... >> No, not exactly, we're talking about different packages here. ... renaming A to B does not create any new package. ...
    (comp.lang.ada)
  • Re: Need volunteers for help on Opensource ports for HP-UX Freeware site
    ... I think the hobbyists need more packages running on 11.0 or even 10.20. ... The PA-RISC 2.0 has an exceptional floating point performance, ... A desktop app doesn't benefit much from fast floating point operations, ... For best performance you'll need the HP compiler, ...
    (comp.sys.hp.hpux)
  • Re: Simple CLOS-Example needed
    ... (defmethod image:load (name STRING) ... The compiler can optimize code better. ...
    (comp.lang.lisp)
  • Re: amd64 questions
    ... I'm not sure what you're saying is false - that the compiler can ... amd64 object files. ... support installing packages from other architectures. ... My copy of the port sets that for amd64 already. ...
    (freebsd-hackers)
  • Re: GNAT Programming System Problems
    ... > GNAT Programming System. ... Unknown packages should have been a warning not an ... > a commercial quality compiler that could be hosted, ... > have been, under Microsoft Visual Studio. ...
    (comp.lang.ada)