Section 10: Program Structure and Compilation Issues

16
Jan

Section 10: Program Structure and Compilation Issues

1 [The overall structure of programs and the facilities for separate compilation are described in this section. A program is a set of partitions, each of which may execute in a separate address space, possibly on a separate computer. 

1.a Glossary entry: {Program} 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.

1.b Glossary entry: {Partition} 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.

2 {library unit (informal introduction)} {library_item (informal introduction)} {library (informal introduction)} 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. {program library: See library} Library units may be organized into a hierarchy of children, grandchildren, and so on.]

3 This section has two clauses: §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

3.a {avoid overspecifying environmental issues} 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.

3.b {safe separate compilation} {separate compilation (safe)} 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.

3.c {legality determinable via semantic dependences} 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.

3.d 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.

3.e See also the “generic contract model” Language Design Principle of §12.3, “Generic Instantiation”. 

Wording Changes from Ada 83

3.f The section organization mentioned above is different from that of RM83.