Design and implementation of generics for the .NET common language runtime

Citation
A. Kennedy et D. Syme, Design and implementation of generics for the .NET common language runtime, ACM SIGPL N, 36(5), 2001, pp. 1-12
Citations number
16
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
36
Issue
5
Year of publication
2001
Pages
1 - 12
Database
ISI
SICI code
1523-2867(200105)36:5<1:DAIOGF>2.0.ZU;2-D
Abstract
The Microsoft .NET Common Language Runtime provides a shared type system, i ntermediate language and dynamic execution environment for the implementati on and inter-operation of multiple source languages. In this paper we exten d it with direct support for parametric polymorphism (also known as generic s), describing the design through examples written in an extended version o f the C# programming language, and explaining aspects of implementation by reference to a prototype extension to the runtime. Our design is very expressive, supporting parameterized types, polymorphic static, instance and virtual methods, "F-bounded" type parameters, instanti ation at pointer and value types, polymorphic recursion, and exact run-time types. The implementation takes advantage of the dynamic nature of the run time, performing justin-time type specialization, representation-based code sharing and novel techniques for efficient creation and use of Nn-time typ es. Early performance results are encouraging and suggest that programmers will not need to pay an overhead for using generics, achieving performance almo st matching hand-specialized code.