Design and implementation of generics for the .NET Common language runtime
- 1 May 2001
- conference paper
- Published by Association for Computing Machinery (ACM)
- Vol. 36 (5) , 1-12
- https://doi.org/10.1145/378795.378797
Abstract
The Microsoft.NET Common Language Runtime provides a shared type system, intermediate language and dynamic execution environment for the implementation and inter-operation of multiple source languages. In this paper we extend it with direct support for parametric polymorphism (also known as generics), describing the design through examples written in an extended version of 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, instantiation at pointer and value types, polymorphic recursion, and exact run-time types. The implementation takes advantage of the dynamic nature of the runtime, performing just-in-time type specialization, representation-based code sharing and novel techniques for efficient creation and use of run-time types.Early performance results are encouraging and suggest that programmers will not need to pay an overhead for using generics, achieving performance almost matching hand-specialized code.Keywords
This publication has 10 references indexed in Scilit:
- Typing a multi-language intermediate codePublished by Association for Computing Machinery (ACM) ,2001
- Parametric polymorphism in JavaPublished by Association for Computing Machinery (ACM) ,2000
- Compatible genericity with run-time types for the Java programming languagePublished by Association for Computing Machinery (ACM) ,1998
- Making the future safe for the pastPublished by Association for Computing Machinery (ACM) ,1998
- Compiling standard ML to Java bytecodesPublished by Association for Computing Machinery (ACM) ,1998
- Pizza into JavaPublished by Association for Computing Machinery (ACM) ,1997
- Parameterized types for JavaPublished by Association for Computing Machinery (ACM) ,1997
- Compiling polymorphism using intensional type analysisPublished by Association for Computing Machinery (ACM) ,1995
- Unboxed objects and polymorphic typingPublished by Association for Computing Machinery (ACM) ,1992
- F-bounded polymorphism for object-oriented programmingPublished by Association for Computing Machinery (ACM) ,1989