skip to main content
10.1145/1449913.1449925acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Integrating semantics and compilation: using c++ concepts to develop robust and efficient reusable libraries

Published:19 October 2008Publication History

ABSTRACT

Concepts are a recently proposed extension to C++ for the direct linguistic support of generic programming. As the interface description mechanism for large-scale generic libraries, concepts do not exist in isolation, but rather in semantic frameworks (or concept lattices). Concepts provide powerful type-checking capabilities for generic programming and the semantics associated with them present new and interesting capabilities for library-compiler interactions. This paper presents some of these emergent capabilities in the context of a library of algebraic concepts. Based on this library, which possesses rich, well-structured and mathematically-based semantics, we demonstrate how the concepts therein can enable a sophisticated oncept-aware design for a broad range of scientific generic libraries. In particular, we show that concepts can enable the description and application of property-based, library-defined, optimizations. Whereas compilers without concepts are limited to optimization of built-in types, library-defined optimizations based on concepts not only allow for optimizations of user-defined types unknown to the compiler, they are even applicable to types unknown to the library developer.

References

  1. O. Bagge, M. Haveraaen, and E. Visser. CodeBoost: A framework for the transformation of C++ programs. Technical report, Universiteit Utrecht, The Netherlands, October 2000.Google ScholarGoogle Scholar
  2. J.-C. Birget, S. Margolis, J. Meakin, and M. Sapir, editors. Algorithmic Problems in Groups and Semigroups. Birkhäuser, Boston, 2000.Google ScholarGoogle ScholarCross RefCross Ref
  3. N. Bourbaki. Algèbre I: Chapitres 1 à 3. Numérisation BnF de l'édition de Paris, 1970.Google ScholarGoogle Scholar
  4. P. Gottschling. Fundamental algebraic concepts in concept-enabled C++. Technical Report 638, Indiana University, 2006.Google ScholarGoogle Scholar
  5. P. Gottschling and W. E. Brown. Toward a more complete taxonomy of algebraic properties for numeric libraries in tr2. Technical Report N2650=08-0160, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++, June 2008.Google ScholarGoogle Scholar
  6. D. Gregor, J. Järvi, J. Siek, B. Stroustrup, G. D. Reis, and A. Lumsdaine. Concepts: Linguistic support for generic programming in C++. In OOPSLA '06, pages 291--310. ACM Press, October 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. K. Henckell and J.-E. Pin. Ordered Monoids in J-Trivial, pages 121--137. In Birget et al. {2}, 2000.Google ScholarGoogle Scholar
  8. M. R. Hestenes and E. Stiefel. Methods of conjugate gradients for solving linear systems. J. Res. Nat. Bur. Standards, 49(6):409--436, December 1952.Google ScholarGoogle ScholarCross RefCross Ref
  9. N. J. Higham. Accuracy and Stability of Numerical Algorithms. SIAM, Philadelphia, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. H. Holin. Boost Quaternion Library. Boost, 2003. www.boost.org/libs/math/quaternion.Google ScholarGoogle Scholar
  11. D. Kapur, D. R. Musser, and X. Nie. An overview of the Tecton Proof System. Theoretical Computer Science, 133:307--339, Oct. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Mechveliani. DoCon the algebraic domain constructor. http://www.haskell.org/docon/.Google ScholarGoogle Scholar
  13. D. R. Musser, S. Schupp, C. Schwarzweller, and R. Loos. The Tecton concept library. Technical report, Fakultät für Informatik, Universität Tübingen, 1999.Google ScholarGoogle Scholar
  14. D. Quinlan. ROSE: Compiler support for object-oriented frameworks. Parallel Processing Letters, 10(2,3):215--226, 2000.Google ScholarGoogle Scholar
  15. J.-F. Raymond, P. Tesson, and D. Thérien. Multiparty Communication Complexity of Finite Monoids, pages 217--233. In Birget et al. {2}, 2000.Google ScholarGoogle Scholar
  16. S. Schupp, D. P. Gregor, and D. R. Musser. Algebraic concepts represented in C++. Technical Report TR-00-8, Rensselaer Polytechnic Institute, 2000. http://www.cs.chalmers.se/~schupp/old_projects/simpl/doc/AlgCpp.pdf.Google ScholarGoogle Scholar
  17. S. Schupp, D. P. Gregor, D. R. Musser, and S.-M. Liu. User-extensible simplification - type-based optimizer generators. In R. Wilhelm, editor, International Conference on Compiler Construction, Lecture Notes in Computer Science, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Siek and A. Lumsdaine. Concept checking: Binding parametric polymorphism in C++. In First Workshop on C++ Template Programming, October 2000.Google ScholarGoogle Scholar
  19. Silicon Graphics, Inc. SGI Implementation of the Standard Template Library, 2004. http://www.sgi.com/tech/stl/.Google ScholarGoogle Scholar
  20. B. Stroustrup and G. Dos Reis. A concept design. C++ Extensions reflector message c++std-ext-7073, April 2005.Google ScholarGoogle Scholar
  21. B. L. van der Waerden. Algebra, Volume I and II. Springer, 1990.Google ScholarGoogle Scholar
  22. E. Visser. Program transformation with Stratego/XT: Rules, strategies, tools, and systems in StrategoXT-0.9. In C. Lengauer et al., editors, Domain-Specific Program Generation, volume 3016 of Lecture Notes in Computer Science, pages 216--238. Spinger-Verlag, June 2004.Google ScholarGoogle Scholar

Index Terms

  1. Integrating semantics and compilation: using c++ concepts to develop robust and efficient reusable libraries

                  Recommendations

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in
                  • Published in

                    cover image ACM Conferences
                    GPCE '08: Proceedings of the 7th international conference on Generative programming and component engineering
                    October 2008
                    194 pages
                    ISBN:9781605582672
                    DOI:10.1145/1449913

                    Copyright © 2008 ACM

                    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 19 October 2008

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • research-article

                    Acceptance Rates

                    Overall Acceptance Rate56of180submissions,31%

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader