Reachability Types: Tracking Aliasing and Separation in Higher-Order Functional Programs

被引:6
|
作者
Bao, Yuyan [1 ]
Wei, Guannan [2 ]
Bracevac, Oliver [2 ]
Jiang, Yuxuan [2 ]
He, Qiyang [2 ]
Rompf, Tiark [2 ]
机构
[1] Univ Waterloo, Waterloo, ON, Canada
[2] Purdue Univ, W Lafayette, IN 47907 USA
来源
基金
美国国家科学基金会; 加拿大自然科学与工程研究理事会;
关键词
reachability types; ownership types; aliasing; type systems; effect systems; LANGUAGE;
D O I
10.1145/3485516
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Ownership type systems, based on the idea of enforcing unique access paths, have been primarily focused on objects and top-level classes. However, existing models do not as readily reflect the finer aspects of nested lexical scopes, capturing, or escaping closures in higher-order functional programming patterns, which are increasingly adopted even in mainstream object-oriented languages. We present a new type system, lambda*, which enables expressive ownership-style reasoning across higher-order functions. It tracks sharing and separation through reachability sets, and layers additional mechanisms for selectively enforcing uniqueness on top of it. Based on reachability sets, we extend the type system with an expressive flow-sensitive effect system, which enables flavors of move semantics and ownership transfer. In addition, we present several case studies and extensions, including applications to capabilities for algebraic effects, one-shot continuations, and safe parallelization.
引用
收藏
页数:32
相关论文
共 50 条