Design and implementation of generics for the .NET Common language runtime
Design and implementation of generics for the .NET Common language runtime
复制标题
DOI:
10.1145/378795.378797
复制
发表时间:
2001-05
期刊:
影响因子:
--
通讯作者:
A. Kennedy;Don Syme
中科院分区:
文献类型:
--
作者:
A. Kennedy;Don Syme
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.