Scoped Capabilities for Polymorphic Effects

07/07/2022
by   Martin Odersky, et al.
0

Type systems usually characterize the shape of values but not their free variables. However, many desirable safety properties could be guaranteed if one knew the free variables captured by values. We describe CCsubBox, a calculus where such captured variables are succinctly represented in types, and show it can be used to safely implement effects and effect polymorphism via scoped capabilities. We discuss how the decision to track captured variables guides key aspects of the calculus, and show that CCsubBox admits simple and intuitive types for common data structures and their typical usage patterns. We demonstrate how these ideas can be used to guide the implementation of capture checking in a practical programming language.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/25/2021

Tracking Captured Variables in Types

Type systems usually characterize the shape of values but not their free...
research
06/10/2023

Formalizing Box Inference for Capture Calculus

Capture calculus has recently been proposed as a solution to effect chec...
research
07/18/2023

Soundly Handling Linearity

We propose a novel approach to soundly combining linear types with effec...
research
09/11/2023

A Mechanized Theory of the Box Calculus

The capture calculus is an extension of System F<: that tracks free vari...
research
05/08/2020

π with leftovers: a mechanisation in Agda

The π-calculus is a computational model for communication and concurrenc...
research
04/15/2019

A Path To DOT: Formalizing Fully-Path-Dependent Types

The Dependent Object Types (DOT) calculus aims to formalize the Scala pr...
research
08/14/2023

Degrees of Separation: A Flexible Type System for Data Race Prevention

Data races are a notorious problem in parallel programming. There has be...

Please sign up or login with your details

Forgot password? Click here to reset