Program |
 |
|
|
Find in Program |
 |
|
|
Page |
 |
|
|
Basket |
 |
|
|
|
|
Modular Generics
Jeremy Siek, Open Systems Laboratory, Indiana University
The purpose of this research is to design a programming language,
named G, for generic programming that improves on C++ and Haskell with
regards to modularity. In previous work we compared several languages
with regards to their support for generic programming, implementing a
generic graph library in each of the languages. We then identified
language features and properties that were important for implementing
the library. Haskell and C++ stood out as providing the best support
for generic programming. However, even these two languages have flaws.
C++ provides neither separate type checking nor separate compilation for
function templates. Even worse, there are loop-holes in the name lookup
rules that defeat the modularity provided by namespaces. In Haskell, there
are also modularity problems: situations can arise where a user may not be
able to use two independently developed libraries due to clashing instance
declarations. Thus, with the design of G we aim to build on the
strengths of C++ and Haskell and improve the modularity of generic
libraries.
|