A Grounded Conceptual Model for Ownership Types in Rust
Will Crichton, Gavin Gray, Shriram Krishnamurthi
摘要
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% (𝑁 = 342, 𝑑 = 0.56).
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Usability Barriers for Liquid Types 引用了 Learning and Programming Challenges of Rust: A Mixed-Methods Study
- Usability Barriers for Liquid Types 引用了 How statically-typed functional programmers write code
- Profiling Programming Language Learning 引用了 Learning and Programming Challenges of Rust: A Mixed-Methods Study
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real Programs 引用了 Learning and Programming Challenges of Rust: A Mixed-Methods Study
引用它的顶会 Paper8
- Identifying and Correcting Programming Language Behavior MisconceptionsKuang-Chen Lu, Shriram KrishnamurthiOOPSLA 2024 · 14 次引用
- Clozemaster: Fuzzing Rust Compiler by Harnessing Llms for Infilling Masked Real ProgramsHongyan Gao, Yibiao Yang, Maolin Sun, Jiangchang Wu 等ICSE 2025 · 6 次引用
- Usability Barriers for Liquid TypesCatarina Gamboa, Abigail Reese, Alcides Fonseca, Jonathan AldrichPLDI 2025 · 4 次引用
- Profiling Programming Language LearningWill Crichton, Shriram KrishnamurthiOOPSLA 2024 · 3 次引用
- An Interactive Debugger for Rust Trait ErrorsGavin Gray, Will Crichton, Shriram KrishnamurthiPLDI 2025 · 1 次引用
它引用的 Paper4
- Learning and Programming Challenges of Rust: A Mixed-Methods StudyShuofei Zhu, Ziyi Zhang, Boqin Qin, Aiping Xiong 等ICSE 2022 · 27 次引用
- How statically-typed functional programmers write codeJustin Lubin, Sarah E. ChasinsOOPSLA 2021 · 17 次引用
- Applying cognitive principles to model-finding output: the positive value of negative informationTristan Dyer, Tim Nelson, Kathi Fisler, Shriram KrishnamurthiOOPSLA 2022 · 10 次引用
- Garbage Collection Makes Rust Easier to Use: A Randomized Controlled Trial of the Bronze Garbage CollectorMichael Coblenz, Michelle L. Mazurek, Michael HicksICSE 2022 · 9 次引用
相关 Paper
- Functional Ownership through Fractional UniquenessDanielle Marshall, Dominic OrchardOOPSLA 2024 · 6 次引用
- Modular information flow through ownershipWill Crichton, Marco Patrignani, Maneesh Agrawala, Pat HanrahanPLDI 2022 · 13 次引用
- Rust-lancet: Automated Ownership-Rule-Violation Fixing with Behavior PreservationWenzhang Yang, Linhai Song, Yinxing XueICSE 2024 · 6 次引用
- Aliasing Limits on Translating C to Safe RustMehmet Emre, Peter Boyland, Aesha Parekh, Ryan Schroeder 等OOPSLA 2023 · 32 次引用
- Flux: Liquid Types for RustNico Lehmann, Adam T. Geller, Niki Vazou, Ranjit JhalaPLDI 2023 · 29 次引用
