Paper record

W2116616150

A comparative study of language support for generic programming

Ronald Garcia, Jaakko Järvi, Andrew Lumsdaine, Jeremy G. Siek, Jeremiah James Willcock

Year
2003
Venue
Conference on Object-Oriented Programming Systems, Languages, and Applications
References
25
Cited by
164

Details and counts from OpenAlex.

Abstract

Many modern programming languages support basic generic programming, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support to a broader, more powerful interpretation of generic programming, and their extensions have proven valuable in practice. This paper reports on a comprehensive comparison of generics in six programming languages: C++, Standard ML, Haskell, Eiffel, Java (with its proposed generics extension), and Generic C. By implementing a substantial example in each of these languages, we identify eight language features that support this broader view of generic programming. We find these features are necessary to avoid awkward designs, poor maintainability, unnecessary run-time checks, and painfully verbose code. As languages increasingly support generics, it is important that language designers understand the features necessary to provide powerful generics and that their absence causes serious difficulties for programmers.