Write a Blog >>
Fri 24 Jan 2020 14:00 - 14:21 at Ile de France III (IDF III) - Language Design Chair(s): Amin Timany

Type systems are useful not just for the safety guarantees they provide, but also for helping compilers generate more efficient code by simplifying important program analyses. In Rust, the type system imposes a strict discipline on pointer aliasing, and it is an express goal of the Rust compiler developers to make use of that alias information for the purpose of program optimizations that reorder memory accesses. The problem is that Rust also supports unsafe code, and programmers can write unsafe code that bypasses the usual compiler checks to violate the aliasing discipline. To strike a balance between optimizations and unsafe code, the language needs to provide a set of rules such that unsafe code authors can be sure, if they are following these rules, that the compiler will preserve the semantics of their code despite all the optimizations it is doing.

In this work, we propose Stacked Borrows, an operational semantics for memory accesses in Rust. Stacked Borrows defines an aliasing discipline and declares programs violating it to have undefined behavior, meaning the compiler does not have to consider such programs when performing optimizations. We give formal proofs (mechanized in Coq) showing that this rules out enough programs to enable optimizations that reorder memory accesses around unknown code and function calls, based solely on intraprocedural reasoning. We also implemented this operational model in an interpreter for Rust and ran large parts of the Rust standard library test suite in the interpreter to validate that the model permits enough real-world unsafe Rust code.

Slides (pdf) (talk.pdf)2.4MiB

Fri 24 Jan

Displayed time zone: Saskatchewan, Central America change

14:00 - 15:05
Language DesignResearch Papers at Ile de France III (IDF III)
Chair(s): Amin Timany imec-Distrinet KU-Leuven
14:00
21m
Talk
Stacked Borrows: An Aliasing Model for Rust
Research Papers
Ralf Jung MPI-SWS, Hoang-Hai Dang MPI-SWS, Jeehoon Kang KAIST, Derek Dreyer MPI-SWS
Link to publication DOI Media Attached File Attached
14:21
21m
Talk
Executable Formal Semantics for the POSIX Shell
Research Papers
Michael Greenberg Pomona College, Austin J. Blatt Puppet Labs
Link to publication DOI Media Attached File Attached
14:43
21m
Talk
Disentanglement in Nested-Parallel Programs
Research Papers
Sam Westrick Carnegie Mellon University, Rohan Yadav Carnegie Mellon University, Matthew Fluet Rochester Institute of Technology, Umut A. Acar Carnegie Mellon University
Link to publication DOI Media Attached File Attached