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

介绍类型属性

Introducing Type Properties

Aziz Akhmedkhodjaev

摘要:

在类型论中,我们可以通过在编译期间将一些附加数据归因于我们操作的表达式来表达许多实际想法。例如,一些子结构类型论用变量的使用信息来增强变量的类型判断。也就是说,它们允许显式地声明变量可以使用多少次- 0,1或多次。这解决了资源使用控制的问题,并允许我们将变量视为资源。更重要的是,经常发生的情况是,这些属性信息在同一次编译过程中被解释(使用),并在我们运行程序之前被删除。这一点的一个例子是,在相同的子结构类型论中,它们的类型检查器使用这些0、1或许多,以确保所有变量被使用的次数与这些属性所说的一样多。然而,没有任何程序设计语言的概念,其关注的是允许程序员在语言本身中表达这些属性。也就是说,让程序员表达他们想要将哪些数据归因于哪些表达式,最重要的是,在他们的程序中属性化数据的含义。事实证明,这样一个概念的存在使我们能够用语言本身来表达许多实际的想法。例如,通过适当的方法来分配这些属性的含义,这个概念将允许人们在单独的程序模块中将线性类型表示为功能,而不需要细化整个类型系统来添加它们。在本文中,我们提出了这样一个概念-我们提出的类型属性。它允许程序员表达这些属性,同时满足完全处于静态级别的要求。也就是说,它允许人们在编译期间表达如何解释这些属性,并在程序传递到运行时之前删除它们。

英文摘要:

In type theory, we can express many practical ideas by attributing some additional data to expressions we operate on during compilation. For instance, some substructural type theories augment variables' typing judgments with the information of their usage. That is, they allow one to explicitly state how many times - 0, 1, or many - a variable can be used. This solves the problem of resource usage control and allows us to treat variables as resources. What's more, it often happens that this attributed information is interpreted (used) during the same compilation and erased before we run a program. A case in the point is that in the same substructural type theories, their type checkers use these 0, 1, or many, to ensure that all variables are used as many times as these attributions say them to be. Yet, there wasn't any programming language concept whose concern would be to allow a programmer to express these attributions in the language itself. That is, to let the programmer express which data the one wants to attribute to what expressions and, most importantly, the meaning of the attributed data in their program. As it turned out, the presence of such a concept allows us to express many practical ideas in the language itself. For instance, with appropriate means for assigning the meaning of these attributions, this concept would allow one to express linear types as functionality in a separate program module, without the need to refine the whole type system to add them. In this paper, we present such a concept - we propose type properties. It allows a programmer to express these attributions while fulfilling the requirement of being fully on the static level. That is, it allows one to express how to interpret these attributions during compilation and erases them before a program is passed to the runtime.

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

↑