Rust-Like Borrowing with 2nd-Class Values (Short Paper)
The Rust programming language demonstrates that memory safety can be achieved in a practical systems language, based on a sophisticated type system that controls object lifetimes and aliasing through notions of ownership and borrowing. While Scala has traditionally targeted only managed language runtimes, the ScalaNative effort makes Scala a viable low-level language as well. Thus, memory safety becomes an important concern, and the question bears asking what, if anything, Scala can learn from Rust. In addition, Rust's type system can encode forms of protocols, state machines, and session types, which would also be useful for Scala in general. A key challenge is that Rust's typing rules are inherently flow-sensitive, but Scala's type system is not. In this paper, we sketch one possible method of achieving static guarantees similar to Rust with only mild extensions to Scala's type system. Our solution is based on two components: First, the observation that continuation passing style (CPS) or monadic style can transform a flow-sensitive checking problem into a type-checking problem based on scopes. Second, on a previously presented type system extension with second-class values, which we use to model scope-based lifetimes.
Sun 22 OctDisplayed time zone: Tijuana, Baja California change
10:30 - 12:00 | |||
10:30 30mTalk | Towards Algorithmic Typing for DOT (Short Paper) Scala 2017 Abel Nieto University of Waterloo DOI Pre-print File Attached | ||
11:00 30mTalk | The Limitations of Type Classes as Subtyped Implicits (Short Paper) Scala 2017 Adelbert Chang Unaffiliated DOI Pre-print | ||
11:30 30mTalk | Rust-Like Borrowing with 2nd-Class Values (Short Paper) Scala 2017 DOI Media Attached |