skip to main content
10.1145/3611096.3611097acmotherconferencesArticle/Chapter ViewAbstractPublication PagesisstaConference Proceedingsconference-collections
short-paper

Rusty Links in Local Chains✱

Published: 16 October 2023 Publication History

Abstract

Rust successfully applies ownership types to control memory allocation. Unfortunately, Rust’s ownership restricts the programs’ topologies to the point where doubly-linked lists cannot be programmed in Safe Rust. We sketch how more flexible “local” ownership could be added to Rust, permitting multiple mutable references to objects, provided each reference is bounded by the object’s lifetime. To maintain thread-safety, locally owned objects must remain thread-local; to maintain memory safety, local objects must remain allocated until their owner’s lifetime expires.

References

[1]
Parastoo Abtahi and Griffin Dietz. 2020. Learning Rust: How Experienced Programmers Leverage Resources to Learn a New Programming Language. In CHI Ext. Abs.1–8.
[2]
Ellen Arvidsson, Elias Castegren, Sylvan Clebsch, Sophia Drossopoulou, James Noble, Matthew J. Parkinson, and Tobias Wrigstad. 2023. Reference Capabilities for Flexible Memory Management. In OOPSLA. To appear.
[3]
Aria Beingessner. 2015. You can’t spell Trust without Rust. Master’s thesis. Computer Science, Carleton University.
[4]
Aria Beingessner. 2019. Learn Rust With Entirely Too Many Linked Lists. https://rust-unofficial.github.io/too-many-lists. Accessed April Fools’ Day 2022.
[5]
David Blaser. 2019. Simple Explanation of Complex Lifetime Errors in Rust. (2019). ETH Zürich.
[6]
R. Bocchino, S. Heumann, N. Honarmand, S. Adve, V. Adve, A. Welc, and T. Shpeisman. 2011. Safe Nondeterminism in a Deterministic-by-Default Parallel Language. In POPL.
[7]
Gregory Bollella, Tim Canham, Vanessa Carson, Virgil Champlin, Daniel L. Dvorak, Brian Giovannoni, Mark B. Indictor, Kenny Meyer, Alex Murray, and Kirk Reinholtz. 2003. Programming with non-heap memory in the real time specification for Java. In OOPSLA Companion. 361–369.
[8]
John Boyland. 2001. Alias Burying: Unique Variables without Destructive Reads. Software: Practice & Experience 31, 6 (May 2001).
[9]
John Boyland. 2003. Checking interference with fractional permissions. In Static Analysis Symposium. 55–72.
[10]
Nicholas Cameron. 2015. What’s the “best” way to implement a doubly-linked list in Rust?http://featherweightmusings.blogspot.com/2015/04/graphs-in-rust.html. Accessed April Fools’ Day 2022.
[11]
Elias Castegren and Tobias Wrigstad. 2016. Reference Capabilities for Concurrency Control. In ECOOP.
[12]
David Chisnall, Matthew Parkinson, and Sylvan Clebsch. 2021. Project Verona. (2021). www.microsoft.com/en-us/research/project/project-verona.
[13]
Dave Clarke, Johan Östlund, Ilya Sergey, and Tobias Wrigstad. 2013. Ownership Types: A Survey. In Aliasing in Object-Oriented Programming. Types, Analysis and Verification. LNCS, Vol. 7850.
[14]
David Clarke, John M. Potter, and James Noble. 1998. Ownership Types for Flexible Alias Protection. In OOPSLA.
[15]
Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, and Andy McNeil. 2015. Deny capabilities for safe, fast actors. In AGERE. 1–12.
[16]
Michael Coblenz, Michelle L. Mazurek, and Michael Hicks. 2022. Does the Bronze Garbage Collector Make Rust Easier to Use? A Controlled Experiment. In ICSE.
[17]
Michael J. Coblenz, Jonathan Aldrich, Brad A. Myers, and Joshua Sunshine. 2020. Can advanced type systems be usable? An empirical study of ownership, assets, and typestate in Obsidian. OOPSLA (2020).
[18]
Russell Cohen. 2018. Why Writing a Linked List in (safe) Rust is So Damned Hard. https://rcoh.me/posts/rust-linked-list-basically-impossible/. Accessed April Fools’ Day 2022.
[19]
Kiko Fernandez-Reyes, Isaac Oscar Gariano, James Noble, Erin Greenwood-Thessman, Michael Homer, and Tobias Wrigstad. 2021. Dala: A Simple Capability-Based Dynamic Language Design For Data Race-Freedom. In Onward!
[20]
Vivian Hu. 2020. Rust Breaks into TIOBE Top 20 Most Popular Programming Languages. (June 2020). InfoQ.
[21]
Ralf Jung, Hoang-Hai Dang, Jeehoon Kang, and Derek Dreyer. 2019. Stacked Borrows: An Aliasing Model for Rust. In POPL.
[22]
Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2017. RustBelt: Securing the Foundations of the Rust Programming Language. PACMPL 2, POPL, Article 66 (Jan. 2017), 66:1–66:34 pages.
[23]
Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, and Derek Dreyer. 2020. Safe Systems Programming in Rust: The Promise and the Challenge. Communications of the ACM (2020).
[24]
Steve Klabnik and Carol Nichols. 2018. The Rust Programming Language (2nd ed.).
[25]
Paul Krill. 2021. Microsoft forms Rust language team. (Feb. 2021). InfoWorld.
[26]
Doug Lea. 1998. Concurrent Programming in Java (2nd ed.). Addison-Wesley.
[27]
Mae Milano, Joshua Turcotti, and Andrew C. Myers. 2022. A Flexible Type System for Fearless Concurrency. In PLDI.
[28]
ndrewxie. 2019. What’s the “best” way to implement a doubly-linked list in Rust?users.rust-lang.org/t/whats-the-best-way-to-implement-a-doubly-linked-list-in-rust/27899/7. Accessed April Fools’ Day 2022.
[29]
James Noble and Charles Weir. 2000. Small Memory Software: Patterns for systems with limited memory. Addison-Wesley.
[30]
David J. Pearce. 2021. A Lightweight Formalism for Reference Lifetimes and Borrowing in Rust. TOPLAS 43, 1 (2021).
[31]
Boqin Qin, Yilun Chen, Zeming Yu, Linhai Song, and Yiying Zhang. 2020. Understanding memory and thread safety practices and issues in real-world Rust programs. In PLDI. 763–779.
[32]
Ryan James Spencer. 2020. Four Ways To Avoid The Wrath Of The Borrow Checker. (2020). justanotherdot.com.
[33]
Bjarne Stroustrup. 1986. The C++ Programming Language.
[34]
James Noble, John Potter, and Jan Vitek. 1998. Flexible Alias Protection. In ECOOP.
[35]
Joshua Yanovski, Hoang-Hai Dang, Ralf Jung, and Derek Dreyer. 2021. GhostCell: separating permissions from data in Rust. In ICFP.

Cited By

View all
  • (2023)Reference Capabilities for Flexible Memory ManagementProceedings of the ACM on Programming Languages10.1145/36228467:OOPSLA2(1363-1393)Online publication date: 16-Oct-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
FTfJP '22: Proceedings of the 24th ACM International Workshop on Formal Techniques for Java-like Programs
June 2022
41 pages
ISBN:9798400707841
DOI:10.1145/3611096
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 October 2023

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Linked Lists
  2. Ownership
  3. Rust

Qualifiers

  • Short-paper
  • Research
  • Refereed limited

Conference

FTfJP '22

Acceptance Rates

Overall Acceptance Rate 51 of 75 submissions, 68%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)12
  • Downloads (Last 6 weeks)1
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Reference Capabilities for Flexible Memory ManagementProceedings of the ACM on Programming Languages10.1145/36228467:OOPSLA2(1363-1393)Online publication date: 16-Oct-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media