Kindly Bent to Free Us

08/26/2019
by   Gabriel Radanne, et al.
0

Systems programming often requires the manipulation of resources like file handles, network connections, or dynamically allocated memory. Programmers need to follow certain protocols to handle these resources correctly. Violating these protocols causes bugs ranging from type mismatches over data races to use-after-free errors and memory leaks. These bugs often lead to security vulnerabilities. While statically typed programming languages guarantee type soundness and memory safety by design, most of them do not address issues arising from improper resource handling. Linear and affine types guarantee single-threaded resource usage, but they are rarely deployed as they are too restrictive for real-world applications. We present Affe, an extension of ML with constrained types that manages linearity and affinity properties through kinds. In addition Affe supports the exclusive and unrestricted borrowing of affine resources, inspired by features of Rust. Moreover, Affe retains the defining features of the ML family: an impure, strict functional expression language with complete principal type inference and type abstraction through modules. Our language does not require any linearity annotations in expressions and supports common functional programming idioms.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/20/2019

QuB: A Resource Aware Functional Programming Language

Managing resources—file handles, database connections, etc.—is a hard pr...
research
03/07/2018

Resource Polymorphism

We present a resource-management model for ML-style programming language...
research
07/18/2023

Soundly Handling Linearity

We propose a novel approach to soundly combining linear types with effec...
research
07/17/2017

FabULous Interoperability for ML and a Linear Language

Instead of a monolithic programming language trying to cover all feature...
research
05/27/2021

Hailstorm : A Statically-Typed, Purely Functional Language for IoT Applications

With the growing ubiquity of Internet of Things(IoT), more complex logic...
research
04/10/2020

Resources: A Safe Language Abstraction for Money

Smart contracts are programs that implement potentially sophisticated tr...
research
08/06/2019

A Dependently Typed Multi-Stage Calculus

We study a dependently typed extension of a multi-stage programming lang...

Please sign up or login with your details

Forgot password? Click here to reset