arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2011.06171cs.PLcs.HC
收藏

所有权的可用性

The Usability of Ownership

Will Crichton

摘要:

所有权是跟踪数据的别名和变化的概念,对内存安全和系统设计都很有用。Rust程序设计语言通过借用检查器实现所有权,借用检查器是一种扩展核心类型系统的静态分析器。借用检查器是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.

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

↑