A comparative study of language support for generic programming

Ronald Garcia, Jaakko Jarvi, Andrew Lumsdaine, Jeremy Siek, Jeremiah Willcock
2003 Proceedings of the 18th ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications - OOPSLA '03  
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
more » ... nting 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.
doi:10.1145/949305.949317 dblp:conf/oopsla/GarciaJLSW03 fatcat:lzkpsqluy5fjpdydnzzny2nlum