Content area

Abstract

We study a fundamental efficiency benefit afforded by delimited control, showing that for certain higher-order functions, a language with advanced control features offers an asymptotic improvement in runtime over a language without them. Specifically, we consider the generic count problem in the context of a pure functional base language \({\lambda_{\textrm{b}}}\) and an extension \({\lambda_{\textrm{h}}}\) with general effect handlers. We prove that \({\lambda_{\textrm{h}}}\) admits an asymptotically more efficient implementation of generic count than any implementation in \({\lambda_{\textrm{b}}}\). We also show that this gap remains even when \({\lambda_{\textrm{b}}}\) is extended to a language \({{{{{{\lambda_{\textrm{a}}}}}}}}\) with affine effect handlers, which is strong enough to encode exceptions, local state, coroutines and single-shot continuations. This locates the efficiency difference in the gap between ‘single-shot’ and ‘multi-shot’ versions of delimited control.

To our knowledge, these results are the first of their kind for control operators.

Details

Identifier / keyword
Title
Asymptotic speedup via effect handlers
Author
HILLERSTRÖM, DANIEL 1   VIAFID ORCID Logo  ; Lindley, Sam 2 ; Longley, John 3 

 Laboratory for Foundations of Computer Science, The University of Edinburgh, Edinburgh EH8 9YL, UK (e-mail: [email protected]
 Laboratory for Foundations of Computer Science, The University of Edinburgh, Edinburgh EH8 9YL, UK (e-mail: [email protected]
 Laboratory for Foundations of Computer Science, The University of Edinburgh, Edinburgh EH8 9YL, UK (e-mail: [email protected]
Publication title
Volume
34
Publication year
2024
Publication date
2024
Publisher
Cambridge University Press
Place of publication
Cambridge
Country of publication
United Kingdom
ISSN
09567968
e-ISSN
14697653
Source type
Scholarly Journal
Language of publication
English
Document type
Journal Article
Publication history
 
 
Milestone dates
2022-12-01 (Received); 2023-12-20 (Revised); 2024-01-26 (Accepted)
ProQuest document ID
3033000105
Document URL
https://www.proquest.com/scholarly-journals/asymptotic-speedup-via-effect-handlers/docview/3033000105/se-2?accountid=208611
Copyright
© The Author(s), 2024. Published by Cambridge University Press. This work is licensed under the Creative Commons Attribution License This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited. (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Last updated
2024-08-27
Database
ProQuest One Academic