What is Generic Programming ?

The last two decades have seen an ever-growing interest in generic programming. As for most programming paradigms, there are several definitions of generic programming in use. In the simplest view generic programming is equated to a set of language mechanisms for implementing type-safe polymorphic containers, such as List<T> in Java. The notion of generic programming that motivated the design of the Standard Template Library (STL) advocates a broader definition: a programming paradigm for designing and developing reusable and efficient collections of algorithms. The functional programming community uses the term as a synonym for polytypic and type-indexed programming, which involves designing functions that operate on data-types having certain algebraic structures. This paper aims at analyzing core mathematical notions at the foundations of rational approaches to generic programming and library design as reasoned and principled activity. We relate several methodologies used and studied in the imperative and functional programming communities. As a necessary step, we provide a base for common understanding of techniques underpinning generic software components and libraries, and their construction, not limited to a particular linguistic support.

[1]  Maarten M. Fokkinga,et al.  Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire , 1991, FPCA.

[2]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[3]  D. Walker,et al.  Patterns and Skeletons for Parallel and Distributed Computing , 2022 .

[4]  Johan Jeuring,et al.  PolyP—a polytypic programming language extension , 1997, POPL '97.

[5]  Alexander A. Stepanov,et al.  Fundamentals of Generic Programming , 1998, Generic Programming.

[6]  Jaakko Järvi,et al.  A comparative study of language support for generic programming , 2003, OOPSLA '03.

[7]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[8]  Lambert Meertens,et al.  Algorithmics : towards programming as a mathematical activity , 1986 .

[9]  Ralf Hinze Generics for the masses , 2006, J. Funct. Program..

[10]  Christopher Strachey,et al.  Fundamental Concepts in Programming Languages , 2000, High. Order Symb. Comput..

[11]  James W. Thatcher,et al.  Data Type Specification: Parameterization and the Power of Specification Techniques , 1982, TOPL.

[12]  Samuel N. Kamin Final Data Types and Their Specification , 1983, TOPL.

[13]  Gerald J. Sussman,et al.  Structure and interpretation of computer programs , 1985, Proceedings of the IEEE.

[14]  Alexander A. Stepanov,et al.  Generic Programming , 1988, ISSAC.

[15]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[16]  Ralf Hinze,et al.  A new approach to generic functional programming , 2000, POPL '00.

[17]  Michael J. Vilot,et al.  Standard template library , 1996 .

[18]  John McCarthy,et al.  Recursive functions of symbolic expressions and their computation by machine, Part I , 1960, Commun. ACM.

[19]  Jaakko Järvi,et al.  The Lambda Library: unnamed functions in C++ , 2003, Softw. Pract. Exp..

[20]  Graham Hutton,et al.  Fold and unfold for program semantics , 1998, ICFP '98.

[21]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.