A comparative study of language support for generic programming

A comparative study of language support for generic programming
复制标题

泛型编程语言支持的比较研究

DOI:
--
复制
发表时间:
2003
期刊:
Conference on Object-Oriented Programming Systems, Languages, and Applications
影响因子:
--
通讯作者:
Jeremiah Willcock
Jeremiah Willcock
中科院分区:
--
文献类型:
--
作者:
Ronald Garcia;Jaakko Järvi;A. Lumsdaine;Jeremy G. Siek;Jeremiah Willcock

文献摘要

被引文献

相似文献

许多现代编程语言都支持基本的通用编程,足以实现类型安全的多态性容器。一些语言已经超越了这种基本支持,对通用编程的更广泛,更有力的解释,其扩展在实践中已证明有价值。本文报告了六种编程语言中仿制药的全面比较:C ++,标准ML,Haskell,Eiffel,Eiffel,Java(及其拟议的仿制药扩展)和仿制药。语言功能支持这种更广泛的通用编程视图。我们发现这些功能对于避免尴尬的设计,可维护性差,不必要的运行时间检查以及痛苦的详细代码是必要的。随着语言越来越多地支持仿制药,语言设计师了解提供强大的仿制药所需的功能,并且它们的缺席为程序员带来了严重的困难,这一点很重要。
Many modern programming languages support basic generic programming, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support to a broader, more powerful interpretation of generic programming, and their extensions have proven valuable in practice. This paper reports on a comprehensive comparison of generics in six programming languages: C++, Standard ML, Haskell, Eiffel, Java (with its proposed generics extension), and Generic C. By implementing a substantial example in each of these languages, we identify eight language features that support this broader view of generic programming. We find these features are necessary to avoid awkward designs, poor maintainability, unnecessary run-time checks, and painfully verbose code. As languages increasingly support generics, it is important that language designers understand the features necessary to provide powerful generics and that their absence causes serious difficulties for programmers.