Advanced type systems that enforce various correctness and safety guarantees--such as linear and ownership types--have a long history in the Programming Languages research community. Despite this history, a human-centered evaluation of these type systems and their usability was all but absent, with empirical evaluations limited to testing their expressiveness in programs written by experts, i.e. the creators of the type system. In the past few years, this has begun to change with the adoption of a version of affine types and ownership in the popular Rust programming language. With the increase in Rust's popularity, various studies have begun empirically evaluating the usability of Rust's Ownership and Lifetime rules, providing a breadth of qualitative and quantitative information on the usability of such type systems. They found that despite Rust's general success in achieving its promise of safety and performance, these rules come with a steep learning curve and have been repeatedly cited as a barrier to adopting Rust. In this report, I provide a brief history of linear types and region-based memory management, which directly inspired Rust's type system. I then introduce Rust's Ownership and Lifetime rules, and present the state-of-the-art in academic research into their usability. I discuss both theoretical arguments and empirical evidence for why these rules are difficult to learn and apply, and survey existing work on addressing some of these difficulties. I also draw from broader works in the HCI and CS Education communities to recommend future work in this area.
翻译:实施各种正确性和安全保障的高级系统(如线性和所有权类型)在“编程语言”研究界具有悠久的历史。尽管历史如此,但对这些类型的系统及其可用性进行了以人为本的评价,尽管缺乏这种评价,但经验性评价仅限于测试专家(即类型系统的创建者)所编写的方案中的清晰度,在过去几年里,随着采用流行的“鲁斯特”语编程语言中的直线类型和所有权,这种评价已经开始改变。随着鲁斯特的受欢迎程度的提高,各种研究已经开始对鲁斯特的“所有权和生命时间规则”的可用性进行实证性评估,就这类系统的可用性提供了大量定性和定量信息。他们发现,尽管鲁斯特在专家(即类型系统的创建者)的节目中总体上取得了成功,但这些规则的学习曲线很陡峭,并一再被引述为采用“鲁斯特”语的流行语言中的直线型类型和基于区域的记忆管理的障碍。随着Rust的受欢迎程度的提高,各种研究已经开始对鲁斯特的“所有权和生命时间规则”的可用性进行实证性评估,随后我将鲁斯特“主人和生命”规则和“生命”的难易用性介绍一下我们目前工作和理论和理论规则的难度和理论领域。他们现在的学习的学习领域。在学术价值和理论和理论研究中,我如何研究领域进行这些困难。