Effects and Coeffects in Call-By-Push-Value (Extended Version)

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Torczon, Cassia, Acevedo, Emmanuel Suárez, Agrawal, Shubh, Velez-Ginorio, Joey, Weirich, Stephanie
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910584870535168
author Torczon, Cassia
Acevedo, Emmanuel Suárez
Agrawal, Shubh
Velez-Ginorio, Joey
Weirich, Stephanie
author_facet Torczon, Cassia
Acevedo, Emmanuel Suárez
Agrawal, Shubh
Velez-Ginorio, Joey
Weirich, Stephanie
contents Effect and coeffect tracking integrate many types of compile-time analysis, such as cost, liveness, or dataflow, directly into a language's type system. In this paper, we investigate the addition of effect and coeffect tracking to the type system of call-by-push-value (CBPV), a computational model useful in compilation for its isolation of effects and for its ability to cleanly express both call-by-name and call-by-value computations. Our main result is effect-and-coeffect soundness, which asserts that the type system accurately bounds the effects that the program may trigger during execution and accurately tracks the demands that the program may make on its environment. This result holds for two different dynamic semantics: a generic one that can be adapted for different coeffects and one that is adapted for reasoning about resource usage. In particular, the second semantics discards the evaluation of unused values and pure computations while ensuring that effectful computations are always evaluated, even if their results are not required. Our results have been mechanized using the Coq proof assistant.
format Preprint
id arxiv_https___arxiv_org_abs_2311_11795
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Effects and Coeffects in Call-By-Push-Value (Extended Version)
Torczon, Cassia
Acevedo, Emmanuel Suárez
Agrawal, Shubh
Velez-Ginorio, Joey
Weirich, Stephanie
Programming Languages
Effect and coeffect tracking integrate many types of compile-time analysis, such as cost, liveness, or dataflow, directly into a language's type system. In this paper, we investigate the addition of effect and coeffect tracking to the type system of call-by-push-value (CBPV), a computational model useful in compilation for its isolation of effects and for its ability to cleanly express both call-by-name and call-by-value computations. Our main result is effect-and-coeffect soundness, which asserts that the type system accurately bounds the effects that the program may trigger during execution and accurately tracks the demands that the program may make on its environment. This result holds for two different dynamic semantics: a generic one that can be adapted for different coeffects and one that is adapted for reasoning about resource usage. In particular, the second semantics discards the evaluation of unused values and pure computations while ensuring that effectful computations are always evaluated, even if their results are not required. Our results have been mechanized using the Coq proof assistant.
title Effects and Coeffects in Call-By-Push-Value (Extended Version)
topic Programming Languages
url https://arxiv.org/abs/2311.11795