Abstract
Generic programming is an especially attractive paradigm for developing libraries for high-performance computing because it simultaneously emphasizes generality and efficiency. In the generic programming approach, interfaces are based on sets of specified requirements on types, rather than on any particular types, allowing algorithms to inter-operate with any data types meeting the necessary requirements. These sets of requirements, known as concepts, can specify syntactic as well as semantic requirements. Besides providing a powerful means of describing interfaces to maximize software reuse, concepts provide a uniform mechanism for more closely coupling libraries with compilers and for effecting domain-specific library-based compiler extensions. To realize this goal however, programming languages and their associated tools must support concepts as first-class constructs. In this paper we advocate better syntactic and semantic support to make concepts first-class and present results demonstrating the kinds of improvements that are possible with static checking, compiler optimization, and algorithm correctness proofs for generic libraries based on concepts.
Similar content being viewed by others
References
M. H. Austern (1999) Generic Programming and the STL. Professional computing series Addison-Wesley Reading MA
R. Garcia, J. Järvi, A. Lumsdaine, J. Siek, and J. Willcock, A Comparative Study of Language Support for Generic Programming, Proceedings of the 18th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, pp. 115–134, ACM press, New York (October 2003).
SGI, Standard Template Library Programmer’s Guide, http://www.sgi.com/tech/stl/ (1997).
R. D. Jenks R. S. Sutor (1992) AXIOM: The Scientific Computation System Springer New York
M. Clavel, F Durán, S. Eker, P Lincoln, N. Martí-Oliet, J. Meseguer, and J. F. Quesada, Maude: Specification and Programming in Rewriting Logic, Theoretical Computer Science, 285:187–243 (2001), URL: http://citeseer.nj.nec.com/clavel01maude.html.
D. Gregor and S. Schupp, Making the Usage of STL Safe, J. Gibbons and J. Jeuring (eds.), Proceedings of the IFIP TC2 Working Conference on Generic Programming, pp. 127–140, Kluwer, Boston (2002).
D. Gregor, High-Level Static Analysis for Generic Libraries, Ph.D. thesis, Rensselaer Polytechnic Institute (April 2004).
D. R. Musser, Algorithm Concepts, http://www.cs.rpi.edu/∼musser/gp/algorithm- concepts (2003).
J. Siek L.-Q. Lee A. Lumsdaine (2002) The Boost Graph Library: User Guide and Reference Manual Addison-Wesley Reading MA
D. Kapur and D. Musser, Tecton: A Framework for Specifying and Verifying Generic System Components, Technical Report RPI-92-20, Department of Computer Science, Rensselaer Polytechnic Institute, Troy, New York 12180 (July 1992), URL http:// citeseer.ist.psu.edu/kapur92tecton.html.
Silicon Graphics, Inc., SGI Implementation of the Standard Template Library (2004), http://www.sgi.com/tech/stl/.
A. A. Stepanov and M. Lee, The Standard Template Library, Technical Report X3J16/94-0095, WG21/N0482, ISO Programming Language C++ Project (May 1994).
A. Kershenbaum, D. Musser, and A. Stepanov, Higher Order Imperative Programming, Technical Report 88-10, Rensselaer Polytechnic Institute (1988).
International Standardization Organization (ISO), ANSI/ISO Standard 14882, Programming Language C++, 1 rue de Varembé, Case postale 56, CH-1211 Genève 20, Switzerland (1998).
L. Zolman, An STL Error Message Decryptor for Visual C++, C/C++ Users Journal (July 2001).
J. Siek and A. Lumsdaine, Concept Checking: Binding Parametric Polymorphism in C++, First Workshop an C++ Template Programming (October 2000).
J. Willcock, J. Siek, and A. Lumsdaine, Caramel: A Concept Representation System for Generic Programming, Second Workshop on C++ Template Programming (October 2001).
J. Järvi, J. Willcock, H. Hinnant, and A. Lumsdaine, Function Overloading Based on Arbitrary Properties of Types, C/C++ Users J. 21(6):25–32 (June 2003).
B. Liskov, A. Snyder, R. Atkinson, and C. Schaffert, Abstraction mechanisms in CLU, Comm. ACM, 20(8):564–576 (1977).
M. Day, R. Gruber, B. Liskov, and A. C. Myers, Subtypes vs. Where Clauses: Constraining Parametric Polymorphism, OOPSLA, pp. 156–158 (1995).
United States Department of Defense, The Programming Language Ada: Reference Manual, ANSI/MIL-STD-1815A-1983 edn. (February 1983).
P. Wadler and S. Blott, How to Make ad-hoc Polymorphism Less ad-hoc, ACM Symposium on Principles of Programming Languages, pp. 60–76, ACM (January 1989).
N. Myers, A New and Useful Technique: “Traits”, C++ Report, 7(5):32–35 (June 1995).
J. Järvi, A. Lurnsdaine, J. Siek, and J. Willcock, An Analysis of Constrained Polymorphism for Generic Programming, K. Davis and J. Striegnitz (eds.), Multiparadigm Programming in Object-Oriented Languages Workshop (MPOOL) at OOPSLA, Anaheim, CA (October 2003).
C. Chambers and the Cecil Group, The Cecil Language: Specification and Rationale, Version 3.1, University of Washington, Computer Science and Engineering (December 2002), http://www.cs.washington.edu/research/projects/cecil/.
S. P. Jones, M. Jones, and E. Meijer, Type classes: an exploration of the design space, Haskell Workshop (June 1997).
X. S. Li, J. W. Dermmel, D. H. Bailey, G. Henry, Y. Hida, J. Iskandar, W. Kahan, S. Y. Kang, A. Kapur, M. C. Martin, B. J. Thompson, T. Tung, and D. J. Yoo, Design, Implementation and Testing of Extended and Mixed Precision BLAS, ACM Trans. on Math. Software, 28(2):152–205 (June 2002).
A. Koenig B. E. Moo (2000) Accelerated C++ Addison-Wesley Reading, MA
S. Schupp D. Gregor D. Musser S.-M. Liu (2002) ArticleTitleSemantic and behaviorial library transformations Special Issue of the J. Inform. Software Technol. 44 IssueID13 797–810
The LiDIA Group, LiDIA—A C++ Library for Computational Number Theory, http://www.informatik.tu-darmstadt.de/TI/LiDIA/.
S. Schupp, D. Gregor, D. R. Musser, and S.-M. Liu, User-Extensible Simplification–Type-Based Optimizer Generators, International Conference on Compiler Construction, number 2027 in LNCS, pp. 86–101 (2001).
J. Siek, Boost Concept Check Library, Boost (2000), http://www.boost.org/libs/concept_check/.
B. Stroustrup and G. Dos Reis, Concepts—Design Choices for Template Argument Checking, Technical Report N1522=03-0105, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++ (October 2003), http://anubis.dkuug.dk/jtc1/sc22/wg2l.
B. Stroustrup, Concepts—A More Abstract Complement to Type Checking, Technical Report N1510=03-0093, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++ (October 2003), http://anubis.dkuug.dk/jtcl/sc22/wg21.
B. Stroustrup and G. Dos Reis, Concepts – syntax and composition, Technical Report N1536=03-0119, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++ (October 2003), http://anubis.dkuug.dk/jtc1/sc22/wg2l.
K. Arkoudas, Denotational Proof Languages, Ph.D. thesis, MIT, Cambridge, MA (2000).
M. Kulkarni and D. R. Musser, Concept Taxonomy for Distributed Algorithms, http://www.cs.rpi.edu/∼kulkam/concepts/pagedir/concindex.html.
J. G. Siek and A. Lumsdaine, The Matrix Template Library: A Generic Programming Approach to High Performance Numerical Linear Algebra, in Proc. of International Symposium on Computing in Object-Oriented Parallel Environments (1998).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Gregor, D., Järvi, J., Kulkarni, M. et al. Generic Programming and High-Performance Libraries. Int J Parallel Prog 33, 145–164 (2005). https://doi.org/10.1007/s10766-005-3580-8
Issue Date:
DOI: https://doi.org/10.1007/s10766-005-3580-8