当前位置: 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.)
The Usability of Ownership
arXiv - CS - Programming Languages Pub Date : 2020-11-12 , DOI: arxiv-2011.06171
Will Crichton

Ownership is the concept of tracking aliases and mutations to data, useful for both memory safety and system design. The Rust programming language implements ownership via the borrow checker, a static analyzer that extends the core type system. The borrow checker is a notorious learning barrier for new Rust users. In this paper, I focus on the gap between understanding ownership in theory versus its implementation in the borrow checker. As a sound and incomplete analysis, compiler errors may arise from either ownership-unsound behavior or limitations of the analyzer. Understanding this distinction is essential for fixing ownership errors. But how are users actually supposed to make the correct inference? Drawing on my experience with using and teaching Rust, I explore the many challenges in interpreting and responding to ownership errors. I also suggest educational and automated interventions that could improve the usability of ownership.

中文翻译:

所有权的可用性

所有权是跟踪数据别名和突变的概念,对内存安全和系统设计都很有用。Rust 编程语言通过借用检查器实现所有权,借用检查器是一种扩展核心类型系统的静态分析器。借用检查器是 Rust 新用户臭名昭著的学习障碍。在本文中,我将重点讨论在理论上理解所有权与其在借用检查器中的实施之间的差距。作为一个健全和不完整的分析,编译器错误可能来自所有权不健全的行为或分析器的限制。了解这种区别对于修复所有权错误至关重要。但是用户实际上应该如何做出正确的推断呢?根据我使用和教授 Rust 的经验,我探索了在解释和响应所有权错误方面的许多挑战。
更新日期:2020-11-13
down
wechat
bug