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.
翻译:在类型理论中,我们可以表达许多实际想法, 将一些额外的数据归结到编译过程中我们操作的表达式。 例如, 某些亚结构型理论会用其使用信息来增加变量的输入判断。 也就是说, 它们允许一个变量明确说明可以使用多少次 - 0, 1 或多个 - 变量。 这解决了资源使用控制的问题, 并允许我们将变量作为资源处理。 更重要的是, 经常会发生这样的情况, 被归为的信息在我们运行一个程序之前, 在同一编译过程中被解译的信息会被解释( 使用) 。 其中的一个例子是, 在同一次结构型理论中, 它们的类型检查器使用这些 0, 1 或许多, 以确保所有变量的输入量都与这些属性所说的值一样多。 然而, 没有任何编程语言概念的概念会让程序员在语言本身中表达这些属性。 也就是说, 由程序员来表达一个明确的表达什么表达什么表达什么表达什么表达什么, 最重要的是, 其被归为程序中的含义。 当它转换出来时,, 这种概念的存在会让我们表达多少个直观的表达这些直观的版本的特性, 。 在这些格式的版本的版本的版本中, 将使得这些格式的版本的版本的版本的版本的版本的版本程序本身意味着, 使得这些特性的特性在文件中, 使得它们可以表达这些特性的特性的特性在文件中的特性的特性本身的特性的特性的特性的特性本身的特性本身是它们本身。