Affiliation:
1. University of Cambridge, Cambridge, United Kingdom
Abstract
The notion of
context
in functional languages no longer refers just to variables in scope. Context can capture additional properties of variables (usage patterns in linear logics; caching requirements in dataflow languages) as well as additional resources or properties of the execution environment (rebindable resources; platform version in a cross-platform application). The recently introduced notion of coeffects captures the latter, whole-context properties, but it failed to capture fine-grained per-variable properties.
We remedy this by developing a generalized coeffect system with annotations indexed by a coeffect
shape
. By instantiating a concrete shape, our system captures previously studied
flat
(whole-context) coeffects, but also
structural
(per-variable) coeffects, making coeffect analyses more useful. We show that the structural system enjoys desirable syntactic properties and we give a categorical semantics using extended notions of
indexed comonad
.
The examples presented in this paper are based on analysis of established language features (liveness, linear logics, dataflow, dynamic scoping) and we argue that such context-aware properties will also be useful for future development of languages for increasingly heterogeneous and distributed platforms.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
11 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Program Synthesis from Graded Types;Lecture Notes in Computer Science;2024
2. Bounded Abstract Effects;ACM Transactions on Programming Languages and Systems;2022-01-12
3. A Framework for Substructural Type Systems;Programming Languages and Systems;2022
4. Deriving Distributive Laws for Graded Linear Types;Electronic Proceedings in Theoretical Computer Science;2021-12-30
5. Kotlin coroutines: design and implementation;Proceedings of the 2021 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software;2021-10-17