paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Grounded Conceptual Model for Ownership Types in Rust

Rust 中所有权类型的一个扎根概念模型
OOPSLA 7(OOPSLA2)2023匹配度 2/10 · 该论文研究Rust所有权类型的教学与概念模型,属于类型系统与开发者工具,但未涉及LLM/Agent、静态分析在ML/Agentic程序中的应用、浮点程序分析或贝叶斯程序分析等用户核心研究方向。引用 23 inbox
Will Crichton, Gavin Gray, Shriram Krishnamurthi
crossref: 2026-09-10

AI 速览

一句话:通过研究 Rust 学习者的所有权误解,提出流敏感权限概念模型与可视化插件,并改进教材教学。

Rust 的所有权类型是其无 GC 内存安全的核心机制,但学习者普遍难以理解。本文系统性地设计了一套所有权教学法:首先通过研究 Rust 开发者的常见误解,构建了测量所有权知识的新工具 Ownership Inventory,发现学习者难以将 Rust 的静态语义与动态语义联系起来,例如无法判断为何某个类型错误的程序会(或不会)产生未定义行为。其次,作者提出一个 Rust 语义的概念模型,用对内存路径的流敏感权限来解释借用检查。第三,实现了一个 Rust 编译器插件,在该模型下可视化程序。第四,将权限模型与可视化整合进更广泛的教学法,为流行教材《The Rust Programming Language》撰写了新的所有权章节。第五,通过读者对 Ownership Inventory 的作答,将新教学法的初步部署与原版进行对比评估。迄今,新教学法使学习者的 Ownership Inventory 平均得分提高了 9。

问题
Rust 学习者难以理解所有权类型,尤其是无法把借用检查的静态语义与程序动态行为(如未定义行为)联系起来。
方法
通过误解研究构建 Ownership Inventory 测评工具,提出以内存路径上的流敏感权限解释借用检查的概念模型,并实现可视化编译器插件、编写新教材章节。
评估
以读者对 Ownership Inventory 的作答为比较基准,将新教学法的初步部署与原版教材教学进行对照评估。
原文摘要(Abstract)

Programmers learning Rust struggle to understand ownership types, Rust’s core mechanism for ensuring memory safety without garbage collection. This paper describes our attempt to systematically design a pedagogy for ownership types. First, we studied Rust developers’ misconceptions of ownership to create the Ownership Inventory, a new instrument for measuring a person’s knowledge of ownership. We found that Rust learners could not connect Rust’s static and dynamic semantics, such as determining why an ill-typed program would (or would not) exhibit undefined behavior. Second, we created a conceptual model of Rust’s semantics that explains borrow checking in terms of flow-sensitive permissions on paths into memory. Third, we implemented a Rust compiler plugin that visualizes programs under the model. Fourth, we integrated the permissions model and visualizations into a broader pedagogy of ownership by writing a new ownership chapter for The Rust Programming Language , a popular Rust textbook. Fifth, we evaluated an initial deployment of our pedagogy against the original version, using reader responses to the Ownership Inventory as a point of comparison. Thus far, the new pedagogy has improved learner scores on the Ownership Inventory by an average of 9

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1857,
  title = {A Grounded Conceptual Model for Ownership Types in Rust},
  author = {Will Crichton and Gavin Gray and Shriram Krishnamurthi},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622841}
}