Towards a theory of packages

Snorri Agnarsson, M. S. Krishnamoorthy
1985 SIGPLAN notices  
A model for packages is introduced, along with operations for their manipulation. The model is based on the unifying principle that programs should be represented by trees, and packages by substitutions on trees. Operations are defined on packages, that allow the construction of any package from a collection of basic packages. A programming environment, based on this model, would allow manipulations and operations that are not possible in current languages. Information hiding and encapsulation
more » ... and encapsulation are automatically supported by the model. A typing mechanism is presented, which allows polymorphic types. The typing does not affect the typeless aspect of the model. © 1985 ACM 0-89791-165-2/85/006/0117 $00.75 117 3. We can more easily think about packages in a lanouage independent fashion. 4. Using the model as an intermediary step between a programming language and its implementation, we are better able to separate our concerns in language design and implementation. We can use a similar mathematical model for different languages, -and different implementations of the same language. 5. The model can also serve as a step between the programming language and its semantics, by defining the semantics of the resulting trees, rather than directly defining the semantics of the language. Thus, the same semantic model can be used for different languages, if they both use the same infinite tree model. 6. Generic programs and packages are natural consequences of the model. 7. The model can be augmented with typing in a formal fashion, and still allow the same operations as before. 8. The operations defined on packages will often allow the programmer to manipulate packages in ways that would otherwise require extensive editing of source code. A programming environment using those package operations would give the programmer powerful tools, and encourage the construction and use of reusable modules or packages. The operations on packages allow the programmer to build his programs from independently written packages. 9. The package operations define the scope of each name {function, subroutine, external variable}, explicitly, in an understandable way. 10. The package operations can be used to give a theoretical basis for linkage editing. For example, we can prove that incremental linking yields the same result as linking everything at once. Since the proper operation of linkage editors is essential to good implementations of packages, it is useful to have a formal groundwork for their functions.
doi:10.1145/17919.806833 fatcat:ffvztthyijb33izqvdv3jji2rq