{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,26]],"date-time":"2026-05-26T23:05:10Z","timestamp":1779836710039,"version":"3.53.1"},"reference-count":56,"publisher":"Cambridge University Press (CUP)","issue":"2","license":[{"start":{"date-parts":[[2007,3,1]],"date-time":"2007-03-01T00:00:00Z","timestamp":1172707200000},"content-version":"unspecified","delay-in-days":0,"URL":"https:\/\/www.cambridge.org\/core\/terms"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["J. Funct. Prog."],"published-print":{"date-parts":[[2007,3]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>Many modern programming languages support basic generics, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support, and in doing so have enabled a broader, more powerful form of generic programming. This paper reports on a comprehensive comparison of facilities for generic programming in eight programming languages: C++, Standard ML, Objective Caml, Haskell, Eiffel, Java, C# (with its proposed generics extension), and Cecil. By implementing a substantial example in each of these languages, we illustrate how the basic roles of generic programming can be represented in each language. We also identify eight language properties that support this broader view of generic programming: support for multi-type concepts, multiple constraints on type parameters, convenient associated type access, constraints on associated types, retroactive modeling, type aliases, separate compilation of algorithms and data structures, and implicit argument type deduction for generic algorithms. We find that these features are necessary to avoid awkward designs, poor maintainability, and painfully verbose code. As languages increasingly support generics, it is important that language designers understand the features necessary to enable the effective use of generics and that their absence can cause difficulties for programmers.<\/jats:p>","DOI":"10.1017\/s0956796806006198","type":"journal-article","created":{"date-parts":[[2006,12,19]],"date-time":"2006-12-19T03:45:54Z","timestamp":1166499954000},"page":"145-205","source":"Crossref","is-referenced-by-count":46,"title":["An extended comparative study of language support for generic programming"],"prefix":"10.1017","volume":"17","author":[{"given":"RONALD","family":"GARCIA","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"JAAKKO","family":"JARVI","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"ANDREW","family":"LUMSDAINE","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"JEREMY","family":"SIEK","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"JEREMIAH","family":"WILLCOCK","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"56","published-online":{"date-parts":[[2007,3,1]]},"reference":[{"key":"S0956796806006198_N10763","doi-asserted-by":"crossref","unstructured":"Ramsey N. , Fisher K. & Govereau P. (2005) An expressive language of signatures. ICFP '05: Proceedings of the Tenth ACM SIGPLAN International Conference on Functional Programming. To appear.","DOI":"10.1145\/1086365.1086371"},{"key":"S0956796806006198_N10745","doi-asserted-by":"publisher","DOI":"10.1002\/j.1538-7305.1957.tb01515.x"},{"key":"S0956796806006198_N10703","unstructured":"Peyton Jones, S. , Jones M. & Meijer E. (1997) Type classes: an exploration of the design space. Proceedings of the Second Haskell Workshop."},{"key":"S0956796806006198_N106F0","unstructured":"Myers N. C. (1995) Traits: a new and useful template technique. C++ report."},{"key":"S0956796806006198_N1067C","doi-asserted-by":"publisher","DOI":"10.5381\/jot.2002.1.2.c8"},{"key":"S0956796806006198_N106B3","unstructured":"Microsoft Corporation (2005) C# version 2.0 specification, march 2005 draft. http:\/\/-msdn.-microsoft.-com\/vcsharp\/-programming\/-language."},{"key":"S0956796806006198_N10665","doi-asserted-by":"crossref","unstructured":"Meyer B. (1995) Static typing. Pages 20\u201329 of: OOPSLA '95: Addendum to the Proceedings of the 10th Annual Conference on Object-oriented Programming Systems, Languages, and Applications. ACM Press.","DOI":"10.1145\/260094.260214"},{"key":"S0956796806006198_N10724","unstructured":"Peyton Jones S. , Hughes J. (1999) Haskell 98: A non-strict, purely functional language. http:\/\/www.haskell.org\/onlinereport\/."},{"key":"S0956796806006198_N10633","unstructured":"McNamara B. & Smaragdakis Y. (2000) Static interfaces in C++. First Workshop on C++ Template Programming."},{"key":"S0956796806006198_N10784","doi-asserted-by":"crossref","unstructured":"R\u00e9my D. & Vouillon J. (1997) Objective ML: a simple object-oriented extension of ML. Pages 40\u201353 of: POPL '97: Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press.","DOI":"10.1145\/263699.263707"},{"key":"S0956796806006198_N105D3","unstructured":"Leroy X. , Doligez D. , Garrigue J. , R\u00e9my D. & Vouillon J. (2003) The Objective Caml documentation and user's manual."},{"key":"S0956796806006198_N105C0","unstructured":"Leroy X. (2000) The Objective Caml system: Documentation and user's manual. With Damien Doligez, Jacques Garrigue, Didier R\u00e9my, and J\u00e9r\u00f4me Vouillon."},{"key":"S0956796806006198_N1052A","doi-asserted-by":"crossref","unstructured":"Kiczales G. , Hilsdale E. , Hugunin J. , Kersten M. , Palm J. & Griswold W. G. (2001) An overview of AspectJ. In: Pages 327\u2013353 of: Knudsen J. L. (ed.), ECOOP 2001 \u2013 Object-oriented Programming 15th European Conference. Lecture Notes in Computer Science, vol. 2072. Springer-Verlag.","DOI":"10.1007\/3-540-45337-7_18"},{"key":"S0956796806006198_N1056D","doi-asserted-by":"publisher","DOI":"10.1093\/comjnl\/43.6.469"},{"key":"S0956796806006198_N1059B","doi-asserted-by":"crossref","unstructured":"Lee L.-Q. , Siek J. G. & Lumsdaine A. (1999) The Generic Graph Component Library. Pages 399\u2013414 of: OOPSLA '99: Proceedings of the 14th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. ACM Press.","DOI":"10.1145\/320385.320428"},{"key":"S0956796806006198_N10619","article-title":"Code reuse considered harmful","volume":"4","author":"Magnusson","year":"1991","journal-title":"J. Object-oriented Program"},{"key":"S0956796806006198_N101CE","doi-asserted-by":"crossref","unstructured":"Bracha G. , Odersky M. , Stoutamire D. & Wadler P. (1998) Making the future safe for the past: adding genericity to the Java programming language. Pages 183\u2013200 of: OOPSLA '98: Proceedings of the 13th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. ACM Press.","DOI":"10.1145\/286936.286957"},{"key":"S0956796806006198_N103B7","doi-asserted-by":"crossref","unstructured":"Hinze R. & Jeuring J. (2003) Generic Haskell: Practice and theory. In: Pages 1\u201356 of: Backhouse R. & Gibbons J. (eds.), Generic programming: Advanced lectures. Lecture Notes in Computer Science, vol. 2793. Springer-Verlag.","DOI":"10.1007\/978-3-540-45191-4_1"},{"key":"S0956796806006198_N1046F","doi-asserted-by":"crossref","unstructured":"Jeuring J. & Jansson P. (1996) Polytypic programming. In: Pages 68\u2013114 of: Launchbury J. , Meijer E. & Sheard T. (eds.), Advanced functional programming, second international school-tutorial text. Lecture Notes in Computer Science, vol. 1129. Springer-Verlag.","DOI":"10.1007\/3-540-61628-4_3"},{"key":"S0956796806006198_N10821","volume-title":"The Boost Graph Library: User guide and reference manual","author":"Siek","year":"2002"},{"key":"S0956796806006198_N1012F","volume-title":"Generic programming and the STL: Using and extending the C++ Standard Template Library","author":"Austern","year":"1998"},{"key":"S0956796806006198_N1022E","doi-asserted-by":"crossref","unstructured":"Chakravarty M. M. T. , Keller G. , Peyton Jones S. & Marlow S. (2005b) Associated types with class. Pages 1\u201313 of: POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press.","DOI":"10.1145\/1040305.1040306"},{"key":"S0956796806006198_N101AE","doi-asserted-by":"publisher","DOI":"10.1090\/qam\/102435"},{"key":"S0956796806006198_N1088F","unstructured":"Stroustrup B. & Dos Reis, G. (2005) A concept design (rev. 1). Tech. rept. N1782=05-0042. ISO\/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++."},{"key":"S0956796806006198_N103E5","unstructured":"Howard M. , Bezault Eric , Meyer Bertrand , Colnet Dominique , Emmanuel Stapf , Arnout K. & Keller M. (2003) Type-safe covariance: competent compilers can catch all catcalls. http:\/\/www.inf.ethz.ch\/meyer\/."},{"key":"S0956796806006198_N1020D","doi-asserted-by":"crossref","unstructured":"Chakravarty M. M. T. , Keller G. & Peyton Jones, S. (2005a) Associated type synonyms. ICFP '05: Proceedings of the International Conference on Functional Programming. ACM Press.","DOI":"10.1145\/1086365.1086397"},{"key":"S0956796806006198_N102FE","volume-title":"Design Patterns: Elements of reusable object-oriented software","author":"Gamma","year":"1995"},{"key":"S0956796806006198_N10602","doi-asserted-by":"crossref","unstructured":"Litvinov V. (1998) Contraint-based polymorphism in Cecil: towards a practical and static type system. Pages 388\u2013411 of: OOPSLA '98: Proceedings of the 13th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications. ACM Press.","DOI":"10.1145\/286936.286979"},{"key":"S0956796806006198_N10147","unstructured":"Backhouse R. , Jansson P. , Jeuring J. & Meertens L. (1999). In: Pages 28\u2013115 of: Swierstra S. D. , Doaitse H. , Rangel P. and Oliveira J. M. (eds.), Advanced Functional Programming, Third International School, Braga, Portugal, revised lectures. Lecture Notes in Computer Science, vol. 1608. Springer-Verlag."},{"key":"S0956796806006198_N1025A","unstructured":"Chambers C. & the Cecil Group. (2002) The Cecil language: Specification and rationale, version 3.1. University of Washington, Computer Science and Engineering. http:\/\/www.cs.washington.edu\/research\/projects\/cecil\/."},{"key":"S0956796806006198_N102D1","doi-asserted-by":"publisher","DOI":"10.1007\/BF01386390"},{"key":"S0956796806006198_N10447","unstructured":"Jazayeri M. , Loos R. , Musser D. & Stepanov A. 1998 (Apr.) Generic Programming. Report of the Dagstuhl seminar on generic programming."},{"key":"S0956796806006198_N104A4","doi-asserted-by":"crossref","unstructured":"Jones M. P. (2000) Type classes with functional dependencies. Pages 230\u2013244 of: ESOP '00: Proceedings of the 9th European Symposium on Programming Languages and Systems. Lecture Notes in Computer Science, vol. 1782. Springer-Verlag.","DOI":"10.1007\/3-540-46425-5_15"},{"key":"S0956796806006198_N106C6","doi-asserted-by":"crossref","DOI":"10.7551\/mitpress\/2319.001.0001","volume-title":"The definition of Standard ML (revised)","author":"Milner","year":"1997"},{"key":"S0956796806006198_N10390","doi-asserted-by":"crossref","unstructured":"Haack C. & Wells J. B. (2003) Type error slicing in implicitly typed higher-order languages. In: Pages 284\u2013301 of: Degano P. (ed.), Programming languages and systems: 12th European Symposium on Programming, ESOP 2003, Warsaw, Poland. Lecture Notes in Computer Science, vol. 2618. New York, NY: Springer-Verlag.","DOI":"10.1007\/3-540-36575-3_20"},{"key":"S0956796806006198_N10328","doi-asserted-by":"crossref","unstructured":"Garcia R. , J\u00e4rvi J. , Lumsdaine A. , Siek J. & Willcock J. (2003) A comparative study of language support for generic programming. Pages 115\u2013134 of: OOPSLA '03: Proceedings of the 18th Annual ACM SIGPLAN Conference on Object-oriented Programing, Systems, Languages, and Applications. ACM Press.","DOI":"10.1145\/949305.949317"},{"key":"S0956796806006198_N10385","unstructured":"Graph Library URL (2005) Available at http:\/\/www.osl.iu.edu\/research\/comparing\/."},{"key":"S0956796806006198_N102B1","doi-asserted-by":"publisher","DOI":"10.1093\/comjnl\/32.4.305"},{"key":"S0956796806006198_N10426","doi-asserted-by":"crossref","unstructured":"J\u00e4rvi J. , Willcock J. & Lumsdaine A. (2005) Associated types and constraint propagation for mainstream object-oriented generics. OOPSLA '05: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object-oriented Programing, Systems, Languages, and Applications. To appear.","DOI":"10.1145\/1094811.1094813"},{"key":"S0956796806006198_N107A2","unstructured":"R\u00e9my D. & Vouillon J. (1998) The reality of virtual types for free! Unpublished note available electronically."},{"key":"S0956796806006198_N107BC","doi-asserted-by":"crossref","unstructured":"Siek J. (2005) A language for generic programming. Ph.D. thesis, Indiana University.","DOI":"10.1145\/1065010.1065021"},{"key":"S0956796806006198_N107CF","unstructured":"Siek J. & Lumsdaine A. (2000) Concept checking: Binding parametric polymorphism in C++. First Workshop on C++ Template Programming."},{"key":"S0956796806006198_N104D9","doi-asserted-by":"crossref","unstructured":"Kiczales G. , Lamping J. , Mendhekar A. , Maeda C. , Lopes C. , Loingtier J.-M. & Irwin J. (1997) Aspect-oriented programming. In: Pages 220\u2013242 of: Ak\u015fit M. & Matsuoka S. (eds.), ECOOP '97 \u2013 Object-oriented Programming 11th European Conference, Jyv\u00e4skyl\u00e4, Finland. Lecture Notes in Computer Science, vol. 1241. Springer-Verlag.","DOI":"10.1007\/BFb0053381"},{"key":"S0956796806006198_N107E9","doi-asserted-by":"crossref","unstructured":"Siek J. & Lumsdaine A. (2005a) Essential language support for generic programming. Pages 73\u201384 of: PLDI '05: Proceedings of the ACM SIGPLAN 2005 Conference on Programming Language Design and Implementation. ACM Press.","DOI":"10.1145\/1065010.1065021"},{"key":"S0956796806006198_N10807","doi-asserted-by":"crossref","unstructured":"Siek J. & Lumsdaine A. (2005b) Language requirements for large-scale generic libraries. GPCE '05: Proceedings of the Fourth International Conference on Generative Programming and Component Engineering. To appear.","DOI":"10.1007\/11561347_27"},{"key":"S0956796806006198_N1018D","unstructured":"Baumgartner G. , Jansche M. & L\u00e4ufer K. (2002) Half & Half: Multiple Dispatch and Retroactive Abstraction for Java. Tech. rept. OSU-CISRC-5\/01-TR08. Ohio State University."},{"key":"S0956796806006198_N1087A","volume-title":"Design and evolution of C++","author":"Stroustrup","year":"1994"},{"key":"S0956796806006198_N104BB","doi-asserted-by":"crossref","unstructured":"Kennedy A. & Syme D. (2001) Design and implementation of generics for the. NET Common Language Runtime. Pages 1\u201312 of: PLDI '01: Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation. ACM Press.","DOI":"10.1145\/378795.378797"},{"key":"S0956796806006198_N108A9","doi-asserted-by":"crossref","unstructured":"Torgersen M. , Hansen C. P. , Ernst E. , von der Ah\u00e9, P. , Bracha G. & Gafter N. (2004) Adding wildcards to the Java programming language. Pages 1289\u20131296 of: SAC '04: Proceedings of the 2004 ACM Symposium on Applied Computing. ACM Press.","DOI":"10.1145\/967900.968162"},{"key":"S0956796806006198_N101FA","unstructured":"Bruce K. B. (1996) Typing in object-oriented languages: Achieving expressibility and safety. Tech. rept. Williams College."},{"key":"S0956796806006198_N1035B","volume-title":"The Java language specification, third edition","author":"Gosling","year":"2005"},{"key":"S0956796806006198_N106A0","unstructured":"Microsoft Corporation (2002) Generics in C#. Part of the Gyro distribution of generics for .NET available at http:\/\/research.microsoft.com\/projects\/clrgen\/."},{"key":"S0956796806006198_N1064D","volume-title":"Eiffel: The language","author":"Meyer","year":"1992"},{"key":"S0956796806006198_N102EF","unstructured":"ECMA (2005) Standard: Eiffel analysis, design and programming language. ECMA International. Draft 5.00.00-1."},{"key":"S0956796806006198_N10274","volume-title":"Pattern Languages of Program Design","author":"Cleeland","year":"1997"},{"key":"S0956796806006198_N10844","unstructured":"Siek J. , Gregor D. , Garcia R. , Willcock J. , J\u00e4rvi J. & Lumsdaine A. (2005) Concepts for C++0x. Tech. rept. N1758=05-0018. ISO\/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++."}],"container-title":["Journal of Functional Programming"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S0956796806006198","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,26]],"date-time":"2026-05-26T22:35:01Z","timestamp":1779834901000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S0956796806006198\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2007,3]]},"references-count":56,"journal-issue":{"issue":"2","published-print":{"date-parts":[[2007,3]]}},"alternative-id":["S0956796806006198"],"URL":"https:\/\/doi.org\/10.1017\/s0956796806006198","relation":{},"ISSN":["0956-7968","1469-7653"],"issn-type":[{"value":"0956-7968","type":"print"},{"value":"1469-7653","type":"electronic"}],"subject":[],"published":{"date-parts":[[2007,3]]}}}