当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Kindly Bent to Free Us
arXiv - CS - Programming Languages Pub Date : 2019-08-26 , DOI: arxiv-1908.09681
Gabriel Radanne, Hannes Saffrich and Peter Thiemann

Systems programming often requires the manipulation of resources like file handles, network connections, or dynamically allocated memory. Programmers need to follow certain protocols to handle these resources correctly. Violating these protocols causes bugs ranging from type mismatches over data races to use-after-free errors and memory leaks. These bugs often lead to security vulnerabilities. While statically typed programming languages guarantee type soundness and memory safety by design, most of them do not address issues arising from improper handling of resources. An important step towards handling resources is the adoption of linear and affine types that enforce single-threaded resource usage. However, the few languages supporting such types require heavy type annotations. We present Affe, an extension of ML that manages linearity and affinity properties using kinds and constrained types. In addition Affe supports the exclusive and shared borrowing of affine resources, inspired by features of Rust. Moreover, Affe retains the defining features of the ML family: it is an impure, strict, functional expression language with complete principal type inference and type abstraction. Affe does not require any linearity annotations in expressions and supports common functional programming idioms.

中文翻译:

请愿意释放我们

系统编程通常需要操作资源,如文件句柄、网络连接或动态分配的内存。程序员需要遵循某些协议来正确处理这些资源。违反这些协议会导致错误,从数据竞争导致的类型不匹配到释放后使用错误和内存泄漏。这些错误通常会导致安全漏洞。虽然静态类型编程语言通过设计保证了类型健全性和内存安全,但它们中的大多数都没有解决因资源处理不当而引起的问题。处理资源的一个重要步骤是采用强制单线程资源使用的线性和仿射类型。但是,支持此类类型的少数语言需要大量类型注释。我们呈现 Affe,ML 的扩展,它使用种类和约束类型来管理线性和亲和性属性。此外,受 Rust 特性的启发,Affe 支持仿射资源的独占和共享借用。此外,Affe 保留了 ML 系列的定义特征:它是一种不纯的、严格的、函数式的表达语言,具有完整的主体类型推断和类型抽象。Affe 在表达式中不需要任何线性注释,并支持常见的函数式编程习惯用法。
更新日期:2020-06-26
down
wechat
bug