arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.00338cs.PL
收藏

动态语言的多态记录

Polymorphic Records for Dynamic Languages

CNRS - Université Paris Cité(法国国家科学研究中心 - 巴黎西岱大学);IMDEA Software Institute(IMDEA软件研究所)

Giuseppe Castagna, Loïc Peyrot

AI总结:

本文为带集合论类型的动态语言定义行多态,通过集合解释定义子类型,给出带字段操作的函数演算及可靠类型系统,并用于Elixir渐进类型系统。

摘要:

我们针对具有集合论类型(特别是并集、交集和否定类型)的类型系统定义并研究了“行多态”。我们考虑嵌入行变量的记录类型,并通过将类型解释为记录值的集合以及将子类型定义为解释的包含关系来定义子类型关系。我们定义了一个函数演算,配备有字段扩展、选择和删除操作,及其操作语义,以及一个我们证明其可靠性的类型系统。我们提供了判定类型关系和子类型关系的算法。这项研究受到当前为动态语言定义静态类型系统趋势的推动,在我们的案例中,则是为 Elixir 编程语言赋予渐进类型系统的持续努力。

英文摘要:

We define and study "row polymorphism" for a type system with set-theoretic types, specifically union, intersection, and negation types. We consider record types that embed row variables and define a subtyping relation by interpreting types into sets of record values and by defining subtyping as the containment of interpretations. We define a functional calculus equipped with operations for field extension, selection, and deletion, its operational semantics, and a type system that we prove to be sound. We provide algorithms for deciding the typing and subtyping relations. This research is motivated by the current trend of defining static type system for dynamic languages and, in our case, by an ongoing effort of endowing the Elixir programming language with a gradual type system.

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

↑