一句话:提出可选的、基于库的 Rust 垃圾回收器 Bronze,并通过大规模随机对照实验证明其能降低复杂别名任务的使用难度。
Rust 不用垃圾回收,而是通过精巧但复杂的类型系统同时实现类型安全与内存安全,这使得它高效却难学难用。作者设计了 Bronze——一个可选的、基于库的 Rust 垃圾回收器,并在一门 633 人的课程中开展随机对照试验,共收集 428 名学生的数据。结果显示,对于需要处理复杂别名的任务,使用 Bronze 的被试更可能在规定时间内完成任务,且完成者耗时约为对照组的三分之一(4 小时 vs. 12 小时);两组的总耗时无显著差异,尽管 Bronze 组随后还需在不使用 Bronze 的情况下重做任务。问卷表明所有权、借用与生命周期是用户使用 Rust 时面临的主要挑战。
Rust is a general-purpose programming language that is both type-and memory-safe. Rust does not use a garbage collector, but rather achieves these properties through a sophisticated, but complex, type system. Doing so makes Rust very efficient, but makes Rust relatively hard to learn and use. We designed Bronze, an optional, library-based garbage collector for Rust. To see whether Bronze could make Rust more usable, we conducted a randomized controlled trial with volunteers from a 633--person class, collecting data from 428 students in total. We found that for a task that required managing complex aliasing, Bronze users were more likely to complete the task in the time available, and those who did so required only about a third as much time (4 hours vs. 12 hours). We found no significant difference in total time, even though Bronze users re-did the task without Bronze afterward. Surveys indicated that ownership, borrowing, and lifetimes were primary causes of the challenges that users faced when using Rust.