Journal of Functional Programming · 2006 · 74 citations · 30 references
ComputingComputer ScienceAlgorithmsProgramming LanguagesSoftware EngineeringData TypesGeneric ProgrammingProgramming Language DesignProgramming Language ImplementationType CheckingType SystemsGeneric AlgorithmsMaintainabilityPolymorphic Type SystemsPolymorphic TypesSeparate CompilationType AliasesType ConstructorsType Polymorphism
Abstract 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.
30
A note on two problems in connexion with graphs
E. Dijkstra · Numerische Mathematik · 1959 · 23.8K citations
Richard Bellman · Quarterly of Applied Mathematics · 1958 · 2.7K citations · Full text
Information and Software Technology · 1992 · 994 citations
Making the future safe for the past
Gilad Bracha, Martin Odersky, David Stoutamire et al. · 1998 · 503 citations · Full text