comp.lang.ada
 help / color / mirror / Atom feed
From: kenner@lab.ultra.nyu.edu (Richard Kenner)
Subject: Re: ifdef replacement for GNAT
Date: 1998/04/13
Date: 1998-04-13T00:00:00+00:00	[thread overview]
Message-ID: <6gt525$ls1$1@news.nyu.edu> (raw)
In-Reply-To: 6gn4q1$ee6@drn.newsguy.com


In article <6gn4q1$ee6@drn.newsguy.com> nabbasi@earthlink.net writes:
>Prof. Dewar, let me try to see what you mean by point (a) above by 
>an example (I am also one of those who learn better by examples, for no
>other reason other than to be clear on what things mean):
>
>Lets assume we have UNIX and VMS (for the purpose of this example). 
>
>Lets assume one wants to create a child process. on UNIX one calls fork(), 
>on VMS one calls vfork(). There are nowadays 3 main methods of how to
>do this.

Let me give my "take" on this, which is that you can't give a
meaningful answer based on only *one* difference.  If everything is
portable except for one thing, it's hard to make a strong case about
which way to handle that single non-portable thing.

But there isn't just one thing; there are many.  And there are also
many more than two systems.  So the whole point is to establish a
methodology for handling the non-portable things and you can't 
illustrate that well with one thing and two systems.

One way you do it is by abstracting them.  You make a list of each of
the areas of non-portability and find an interface that works for all
systems for each of them.  Then you can have one module that handles
all the non-portablilities.

Another is to try to find commonalities and conditionalizations that
aren't necessarily system dependent.  So suppose you find something
that can be done one of two ways (e.g., big or little endian).  Rather
than conditionalizing each place with "systems A, B, C, D, and E are
this way".  Say "big endian is this way and little endian is this
way".  Then have a configuration file for each system saying which of
the attributes is true for it.

Very roughly speaking, the first approach is typically the way GNAT
and GCC handles *host* dependencies and the latter is the way it
handles *target* dependencies.




  parent reply	other threads:[~1998-04-13  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <352287EE.1CFB@tolstoy.mdc.com>
1998-04-08  0:00 ` ifdef replacement for GNAT John T Vegezzi 312C M 237110
1998-04-09  0:00   ` Robert Dewar
1998-04-10  0:00     ` Dirk Zoller
1998-04-10  0:00       ` Robert Dewar
1998-04-11  0:00         ` nabbasi
1998-04-11  0:00           ` Larry Kilgallen
1998-04-13  0:00           ` Richard Kenner [this message]
1998-04-11  0:00         ` Larry Kilgallen
1998-04-11  0:00         ` raw
1998-04-13  0:00         ` Michael F Brenner
1998-04-13  0:00           ` Larry Kilgallen
1998-04-15  0:00             ` Ada Programming Environment [was ifdef replacement for GNAT] Nick Roberts
1998-04-14  0:00         ` ifdef replacement for GNAT Jean-Pierre Rosen
1998-04-11  0:00       ` Geert Bosch
1998-04-12  0:00         ` Haug Buerger
1998-04-13  0:00           ` Aaro Koskinen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox