10 Program Structure and Compilation Issues
{
AI05-0299-1}
[The overall structure of programs and the facilities for separate compilation
are described in this clause. A
program is a set of
partitions,
each of which may execute in a separate address space, possibly on a
separate computer.
Glossary entry: A program is a
set of partitions, each of which may execute in a separate address
space, possibly on a separate computer. A partition consists of a set
of library units.
Glossary entry: A partition is
a part of a program. Each partition consists of a set of library units.
Each partition may run in a separate address space, possibly on a separate
computer. A program may contain just one partition. A distributed program
typically contains multiple partitions, which can execute concurrently.
As
explained below, a partition is constructed from
library units.
Syntactically, the declaration of a library unit is a
library_item,
as is the body of a library unit. An implementation may support a concept
of a
program library (or simply, a “library”), which
contains
library_items
and their subunits.
Library units may be organized
into a hierarchy of children, grandchildren, and so on.]
{
AI05-0299-1}
This clause has two subclauses:
10.1, “
Separate
Compilation” discusses compile-time issues related to separate
compilation.
10.2, “
Program
Execution” discusses issues related to what is traditionally
known as “link time” and “run time” — building
and executing partitions.
Language Design Principles
We should avoid specifying
details that are outside the domain of the language itself. The standard
is intended (at least in part) to promote portability of Ada programs
at the source level. It is not intended to standardize extra-language
issues such as how one invokes the compiler (or other tools), how one's
source is represented and organized, version management, the format of
error messages, etc.
The
rules of the language should be enforced even in the presence of separate
compilation. Using separate compilation should not make a program less
safe.
It should be possible to
determine the legality of a compilation unit by looking only at the compilation
unit itself and the compilation units upon which it depends semantically.
As an example, it should be possible to analyze the legality of two compilation
units in parallel if they do not depend semantically upon each other.
On the other hand, it may be necessary to look
outside that set in order to generate code — this is generally
true for generic instantiation and inlining, for example. Also on the
other hand, it is generally necessary to look outside that set in order
to check Post-Compilation Rules.
Wording Changes from Ada 83
{
AI05-0299-1}
The clause organization mentioned above is different from that of RM83.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe