论文标题

所有权的可用性

The Usability of Ownership

论文作者

Crichton, Will

论文摘要

所有权是跟踪数据的别名和突变与数据的概念,对记忆安全和系统设计都有用。生锈的编程语言通过借用检查器实现所有权,这是一种扩展核心类型系统的静态分析仪。对于新的Rust用户来说,借用检查器是臭名昭著的学习障碍。在本文中,我专注于理解理论的所有权与在借用检查员中实施之间的差距。作为一项合理和不完整的分析,编译器错误可能是由所有权无方便的行为或分析仪的局限性引起的。了解这种区别对于解决所有权错误至关重要。但是,用户实际上应该如何做出正确的推论?利用我在使用和教授Rust的经验,我探讨了解释和回应所有权错误的许多挑战。我还建议教育和自动化干预措施,以提高所有权的可用性。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源