arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 0708.2255cs.PLcs.SE
收藏

一种通用程序设计语言

A Language for Generic Programming in the Large

Jeremy G. Siek, Andrew Lumsdaine

摘要:

泛型编程是开发可重用软件库的一种有效方法。许多程序设计语言都提供泛型并具有描述接口的特性,但没有一种语言完全支持泛型编程中使用的习惯用法。为了满足这一需求,我们开发了G语言。G的核心特征是概念,一种组织泛型约束的机制,它受到现代C++库需求的启发。G提供了模块化的类型检查和单独的编译(即使是泛型)。这些特性支持模块化软件的开发,特别是独立开发的组件的平滑集成。在这篇文章中,我们介绍了G的设计原理,并通过两个案例研究展示了G的表达能力:将标准模板库和Boost图形库从C++移植到G。G的设计与为下一个C++标准提出的概念扩展(作者参与了其设计)有很多共同之处,但本文中描述了重要的差异。

英文摘要:

Generic programming is an effective methodology for developing reusable software libraries. Many programming languages provide generics and have features for describing interfaces, but none completely support the idioms used in generic programming. To address this need we developed the language G. The central feature of G is the concept, a mechanism for organizing constraints on generics that is inspired by the needs of modern C++ libraries. G provides modular type checking and separate compilation (even of generics). These characteristics support modular software development, especially the smooth integration of independently developed components. In this article we present the rationale for the design of G and demonstrate the expressiveness of G with two case studies: porting the Standard Template Library and the Boost Graph Library from C++ to G. The design of G shares much in common with the concept extension proposed for the next C++ Standard (the authors participated in its design) but there are important differences described in this article.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑