Thesis (PhD) - Indiana University, Computer Sciences, 2005
The past decade of software library construction has demonstrated that the discipline of generic programming is an effective approach to the design and implementation of large-scale software libraries. At the heart of generic programming is a semi-formal interface specification language for generic components. Many programming languages have features for describing interfaces, but none of them match the generic programming specification language, and none are as suitable for specifying generic components. This lack of language support impedes the current practice of generic programming. In this dissertation I present and evaluate the design of a new programming language, named G (for generic), that integrates the generic programming specification language with the type system and features of a full programming language. The design of G is based on my experiences, and those of colleagues, in the construction of generic libraries over the past decade. The design space for programming languages is large, thus this experience is vital in guiding choices among the many tradeoffs. The design of G emphasizes modularity because generic programming is inherently about composing separately developed components. In this dissertation I demonstrate that the design is implementable by constructing a compiler for G (translating to C++) and show the suitability of G for generic programming with prototypes of the Standard Template Library and the Boost Graph Library in G. I formalize the essential features of G in a small language and prove type soundness.