arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2309.14985cs.PL
收藏

可扩展数据类型的类型与语义(扩展版)

Types and Semantics for Extensible Data Types (Extended Version)

Cas van der Rest, Casper Bach Poulsen

AI总结:

针对编程语言难以同时扩展数据类型构造器与函数的问题,本文提出原生支持初始代数语义的类型体系和核心演算,以减少编码开销并支持 map/fold 融合优化。

摘要:

开发和维护软件通常既需要(1)向现有应用程序添加新的数据类型构造器,也需要(2)添加处理现有数据的新函数。大多数编程语言对定义数据类型和函数的原生支持只能满足(1)或(2)中的一项,而不能同时兼顾两者。这种原生支持的缺失使得库的使用和扩展变得困难。一个在理论上得到充分研究的解决方案是使用初始代数语义来定义数据类型和函数。虽然可以在现有编程语言中编码这一解决方案,但此类编码会带来语法和解释开销,并且通常无法利用初始代数的 map 与 fold 融合定律,而编译器本可以利用这些定律生成更高效的代码。解决这些问题的一种办法是为初始代数语义提供原生支持。在本文中,我们开发了这样一种解决方案,并提出了一种类型体系和核心演算,用于一种原生支持初始代数语义的语言。

英文摘要:

Developing and maintaining software commonly requires (1) adding new data type constructors to existing applications, but also (2) adding new functions that work on existing data. Most programming languages have native support for defining data types and functions in a way that supports either (1) or (2), but not both. This lack of native support makes it difficult to use and extend libraries. A theoretically well-studied solution is to define data types and functions using initial algebra semantics. While it is possible to encode this solution in existing programming languages, such encodings add syntactic and interpretive overhead, and commonly fail to take advantage of the map and fold fusion laws of initial algebras which compilers could exploit to generate more efficient code. A solution to these is to provide native support for initial algebra semantics. In this paper, we develop such a solution and present a type discipline and core calculus for a language with native support for initial algebra semantics.

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

↑