Results 1 -
3 of
3
A Comparative Study of Language Support for Generic Programming
, 2003
"... 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. ..."
Abstract
-
Cited by 69 (12 self)
- Add to MetaCart
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.
Essential language support for generic programming
- In PLDI ’05
, 2005
"... “Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In th ..."
Abstract
-
Cited by 26 (4 self)
- Add to MetaCart
“Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In this paper we formalize the design of a type system and semantics for concepts that is suitable for non-type-inferencing languages. Our design shares much in common with the type classes of Haskell, though our primary influence is from best practices in the C ++ community, where concepts are used to document type requirements for templates in generic libraries. The technical development in this paper defines an extension to System F and a type-directed translation from the extension back to System F. The translation is proved sound; the proof is written in the human readable but machine checkable Isar language and has been automatically verified by the Isabelle proof assistant. This document was generated directly from the Isar theory files using Isabelle’s support for literate proofs.
Unifying Software Similarity Patterns with a Meta-level Generative Technique: A Case Study and Evaluation 1
"... Abstract – In a previous study, we analyzed similarity patterns in the Java Buffer library, JDK 1.5. We observed many similar classes, methods and yet smaller fragments- elements of class design. We argued that, given the design goals, it was difficult to avoid those repetitions with conventional de ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Abstract – In a previous study, we analyzed similarity patterns in the Java Buffer library, JDK 1.5. We observed many similar classes, methods and yet smaller fragments- elements of class design. We argued that, given the design goals, it was difficult to avoid those repetitions with conventional design techniques. We also argued that the reasons why the problem arises and its symptoms are common. In this paper, we describe a possible solution to the problem: We apply a meta-level method of XVCL on top of Java code, to unify differences among similar buffer classes. In a meta-level Java-XVCL solution, we represent each of the important similarity patterns in a unique generic, but adaptable, form, along with information necessary to obtain its instances – specific classes or class methods. We believe such explication of similarity patterns reduces program complexity as perceived by developers. Non-redundancy achieved in that way also reduces the risk of update anomalies which helps in maintenance. As the meta-level solution does not come for free, we evaluate its strengths and weaknesses in quantitative and qualitative way, and also by conducting a controlled experiment. The presented method is based on synergistic use of a programming language (e.g., Java) and meta-level parameterization and manipulation supported by XVCL, to achieve a non-redundancy of the Java-XVCL meta-level solution. The idea of the solution and the method itself is general, can be applied to any program, independently of an application domain or a programming language. We believe some of the observations from this case study apply to other class libraries, as well as application programs.

