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
中科院分区:
其他
文献类型:
--
作者:
A. Kennedy;Don Syme

文献摘要

被引文献

相似文献

Microsoft.NET公共语言运行时提供了共享类型系统,中间语言和动态执行环境,以实现和操作多种源语言。通过用C#编程语言的扩展版本编写的示例来描述设计,并通过参考运行时的原型扩展来解释实现的方面。我们的设计非常表现力,支持参数化的类型,多态性静态,实例和虚拟方法,“ f键入”类型参数,指针和值类型的实例化,多态性递归以及精确的运行时间。运行时的性质,执行即时类型的专业化,基于表示的代码共享以及有效创建和使用运行时间的新技术是令人鼓舞的。建议程序员不需要为使用仿制药支付间接费用,从而实现绩效几乎匹配的手工专业代码。
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.