ACM Home Page
Please provide us with feedback. Feedback
Open multi-methods for c++
Full text PdfPdf (428 KB)
Source
Generative Programming And Component Engineering archive
Proceedings of the 6th international conference on Generative programming and component engineering table of contents
Salzburg, Austria
SESSION: Session 5 table of contents
Pages: 123 - 134  
Year of Publication: 2007
ISBN:978-1-59593-855-8
Authors
Peter Pirkelbauer  Texas A&M University, College Station, TX
Yuriy Solodkyy  Texas A&M University, College Station, TX
Bjarne Stroustrup  Texas A&M University, College Station, TX
Sponsors
SIGSOFT: ACM Special Interest Group on Software Engineering
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 12,   Downloads (12 Months): 103,   Citation Count: 2
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1289971.1289993
What is a DOI?

ABSTRACT

Multiple dispatch - the selection of a function to be invoked based on the dynamic type of two or more arguments - is a solution to several classical problems in object-oriented programming. Open multi-methods generalize multiple dispatch towards open-class extensions, which improve separation of concerns and provisions for retroactive design. We present the rationale, design, implementation, and performance of a language feature, called open multi-methods, for C++. Our open multi-methods support both repeated and virtual inheritance. Our call resolution rules generalize both virtual function dispatch and overload resolution semantics. After using all information from argument types, these rules can resolve further ambiguities by using covariant return types. Great care was taken to integrate open multi-methods with existing C++ language features and rules. We describe a model implementation and compare its performance and space requirements to existing open multi-method extensions and workaround techniques for C++. Compared to these techniques, our approach is simpler to use, catches more user mistakes, and resolves more ambiguities through link-time analysis, runs significantly faster, and requires less memory. In particular, the runtime cost of calling an open multi method is constant and less than the cost of a double dispatch (two virtual function calls). Finally, we provide a sketch of a design for open multi-methods in the presence of dynamic loading and linking of libraries.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
 
4
 
5
 
6
7
 
8
 
9
 
10
C. Chambers. The Cecil language: Specification and rationale. 3.2. Technical report, Department of Computer Science and Engineering. University of Washington, 2004.
11
12
 
13
Codesourcery.com. The Itanium C++ ABI. Technical report, 2001.
 
14
 
15
Edison Design Group. C++ Front End, March 2006.
 
16
C. B. Flynn and D. Wonnacott. Reconciling encapsulation and dynamic dispatch via accessory functions. Technical Report 387, Rutgers University Department of Computer Science, 1999.
 
17
B. Foote, R. Johnson, and J. Noble. Efficient Multimethods in a Single Dispatch Language. Proceedings of the European Conference on Object-Oriented Programming, Glasgow, Scotland, July, 2005.
 
18
 
19
 
20
21
 
22
International Organization for Standardization. ISO/IEC 10918-1:1994: Information technology - Digital compression and coding of continuous-tone still images: Requirements and guidelines. 1994.
 
23
ISO/IEC 14882 International Standard. Programming languages C++. American National Standards Institute, September 1998.
24
 
25
Lockheed Martin. Joint Strike Fighter, Air Vehicle, C++ Coding Standard. Lockheed Martin, December 2005.
 
26
27
 
28
 
29
M. Schordan and D. Quinlan. A source-to-source architecture for user-defined optimizations. In JMLC'03, volume 2789 of LNCS, pages 214--223. Springer-Verlag, August 2003.
 
30
A. Shalit. The Dylan Reference Manual. 2nd edition. Apple Press, 1996.
 
31
J. Smith. Draft proposal for adding multimethods to C++. Technical Report N1463, JTC1/SC22/WG21 C++ Standards Committee, 2003.
 
32
 
33
 
34
 
35
B. Stroustrup and G. Dos Reis. Supporting SELL for high-performance computing. In LCPC'05, volume 4339 of LNCS, pages 458--465. Springer-Verlag, October 2005.
 
36
G. van Rossum. The Python Language Reference Manual. Network Theory Ltd., September 2003.
37
38
 
39
 
40
A. Wöß, M. Löberbauer, and H. Mössenböck. LL(1) conflict resolution in a recursive descent compiler generator. In JMLC'03, volume 2789 of LNCS, pages 192--201. Springer-Verlag, 2003.
 
41
www.fourcc.org. Video codec and pixel format definition, February 2007.


Collaborative Colleagues:
Peter Pirkelbauer: colleagues
Yuriy Solodkyy: colleagues
Bjarne Stroustrup: colleagues