comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
Subject: Re: generic package dilemma
Date: 1999/12/03
Date: 1999-12-03T00:00:00+00:00	[thread overview]
Message-ID: <828mu3$8i0$1@nnrp1.deja.com> (raw)
In-Reply-To: 38464A8F.FDE762F9@mail.com

In article <38464A8F.FDE762F9@mail.com>,
  Mats Weber <matsw@mail.com> wrote:
> That is just what I did in my thesis

There are a number of other explorations of this idea (basically
the idea of tracing all possible static flows through a
program). In particular, there was an exploration of this idea
during the Ada 83 design, and if I remember, a corresponding
LSN, and also more recently some work at Binghamton and a
published paper.

The difficulty is that it is probably not practical to mandate
this kind of program wide analysis as a standard feature of
all compilers.

The GNAT approach, by contrast, can be simply done on a unit
by unit basis (static tracing occurs only within a unit), and
the approach for inter-unit analysis corresponds in a simple
manner to good Ada coding practice (the fundamental principle
that a client of a package should rely only on the spec, and
not on detailed knowledge of the structure or code of the body).

The trouble with this general tracing schemes is that they can
still leave you in a situation where your program compiles and
runs, and then you change something in a body, and the program
no longer compiles because some client somewhere was making
elaboration related assumptions about the contents of this body.

Of course a compiler that did the full tracing would do a much
better job in the fully dynamic case of finding a workable
elaboration order, but that's a mixed blessing. The trouble is
that if the compiler finds this order for you, then your program
may be seriously non-portable and you don't realize it (until
you try to port to another system). In fact in GNAT we provide
the -p (pessimistic elaboration order) option for the binder.
This option is relevant only if you are using fully dynamic
elaboration (compiling with the -gnatE switch), and it causes
the binder to choose what it thinks is the WORST possible
elaboration order, to help smoke out such lurking bugs :-)

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-12-03  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-17  0:00 generic package dilemma Riyaz Mansoor
1999-11-17  0:00 ` Matthew Heaney
1999-11-17  0:00   ` Mats Weber
1999-11-17  0:00     ` Matthew Heaney
1999-11-18  0:00       ` Robert A Duff
1999-11-18  0:00         ` Matthew Heaney
1999-11-18  0:00       ` Mats Weber
1999-11-18  0:00         ` Matthew Heaney
1999-11-19  0:00           ` Mats Weber
1999-11-19  0:00             ` Vladimir Olensky
1999-11-19  0:00             ` Matthew Heaney
1999-11-19  0:00               ` Mats Weber
1999-11-22  0:00                 ` Robert Dewar
1999-11-22  0:00                   ` Robert A Duff
1999-11-23  0:00                     ` Robert Dewar
1999-11-29  0:00                       ` Robert A Duff
1999-12-01  0:00                         ` Robert Dewar
1999-12-01  0:00                       ` Robert A Duff
1999-12-02  0:00                         ` Mats Weber
1999-12-03  0:00                           ` Robert Dewar [this message]
1999-12-03  0:00                             ` Robert A Duff
1999-12-06  0:00                               ` Robert Dewar
1999-12-03  0:00                             ` Ted Dennison
1999-12-04  0:00                               ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Robert A Duff
1999-11-23  0:00                       ` Robert Dewar
1999-12-01  0:00                       ` Robert I. Eachus
1999-12-01  0:00                         ` Robert I. Eachus
1999-11-22  0:00                   ` Larry Kilgallen
1999-11-23  0:00                     ` Robert Dewar
1999-11-22  0:00                   ` Mats Weber
1999-11-22  0:00                     ` Bryce Bardin
1999-11-23  0:00                     ` Robert Dewar
1999-11-19  0:00               ` Robert Dewar
1999-11-19  0:00                 ` Matthew Heaney
1999-11-20  0:00                   ` Mats Weber
1999-11-19  0:00                 ` Robert I. Eachus
1999-11-22  0:00                   ` Robert Dewar
1999-11-22  0:00                     ` Matthew Heaney
1999-11-19  0:00       ` Robert Dewar
1999-11-18  0:00   ` Riyaz Mansoor
1999-11-19  0:00     ` Robert Dewar
1999-11-19  0:00   ` Robert Dewar
replies disabled

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