Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2628136.2628160acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Coeffects: a calculus of context-dependent computation

Published: 19 August 2014 Publication History

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.

References

[1]
M. Abbott, T. Altenkirch, and N. Ghani. Containers: constructing strictly positive types. Theor. Comput. Sci., 342 (1): 3--27, 2005.
[2]
G. M. Bierman and V. C. de Paiva. On an intuitionistic modal logic. Studia Logica, 65 (3): 383--416, 2000.
[3]
A. Brunel, M. Gaboardi, D. Mazza, and S. Zdancewic. A core quantitative coeffect calculus. In Proceedings of ESOP, volume 8410 of Lecture Notes in Computer Science, pages 351--370. Springer, 2014.
[4]
C. Flanagan and S. Qadeer. A type and effect system for atomicity. In Prooceedings of PLDI, pages 338--349. ACM, 2003.
[5]
D. R. Ghica and A. I. Smith. Bounded linear types in a resource semiring. In Proceedings of ESOP, volume 8410 of Lecture Notes in Computer Science, pages 331--350. Springer, 2014.
[6]
D. K. Gifford and J. M. Lucassen. Integrating functional and imperative programming. In Proceedings of Conference on LISP and func. prog., LFP '86, 1986. ISBN 0-89791-200-4.
[7]
J.-Y. Girard, A. Scedrov, and P. J. Scott. Bounded linear logic: a modular approach to polynomial-time computability. Theoretical computer science, 97 (1): 1--66, 1992.
[8]
S. Katsumata. Parametric effect monads and semantics of effect systems. In Proceedings of POPL, pages 633--646. ACM, 2014.
[9]
J. Lewis, J. Launchbury, E. Meijer, and M. Shields. Implicit parameters: Dynamic scoping with static types. In Proceedings of POPL, page 118, 2000.
[10]
E. Moggi. Notions of computation and monads. Inf. Comput., 93 (1), 1991. ISSN 0890-5401.
[11]
A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Trans. Comput. Logic, 9 (3): 23:1--23:49, June 2008.
[12]
P. O'Hearn. On bunched typing. J. Funct. Program., 13 (4): 747--796, July 2003. ISSN 0956-7968.
[13]
D. Orchard. Programming contextual computations (PhD dissertation). Technical Report UCAM-CL-TR-854, University of Cambridge, Computer Laboratory, 2014. URL http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-854.pdf.
[14]
T. Petricek. Context-aware programming languages (PhD thesis), 2014. Forthcoming.
[15]
T. Petricek, D. A. Orchard, and A. Mycroft. Coeffects: Unified static analysis of context-dependence. In F. V. Fomin, R. Freivalds, M. Z. Kwiatkowska, and D. Peleg, editors, ICALP (2), volume 7966 of Lecture Notes in Computer Science, pages 385--397. Springer, 2013.
[16]
F. Pfenning and R. Davies. A judgmental reconstruction of modal logic. Mathematical. Structures in Comp. Sci., 11 (4): 511--540, 2001.
[17]
P. Sewell, J. J. Leifer, K. Wansbrough, F. Z. Nardelli, M. Allen-Williams, P. Habouzit, and V. Vafeiadis. Acute: High-level programming language design for distributed computation. J. Funct. Program., 17 (4-5): 547--612, July 2007.
[18]
R. Tate. The sequential semantics of producer effect systems. In Proceedings of POPL 2013, pages 15--26, 2013.
[19]
T. Uustalu and V. Vene. Comonadic notions of computation. Electron. Notes Theor. Comput. Sci., 203 (5): 263--284, 2008. http://dx.doi.org/10.1016/j.entcs.2008.05.029.
[20]
W. W. Wadge and E. A. Ashcroft. LUCID, the dataflow programming language. Academic Press Professional, Inc., San Diego, CA, USA, 1985. ISBN 0-12-729650-6.
[21]
P. Wadler and P. Thiemann. The marriage of effects and monads. ACM Trans. Comput. Logic, 4: 1--32, January 2003.

Cited By

View all
  • (2024)Effects and Coeffects in Call-by-Push-ValueProceedings of the ACM on Programming Languages10.1145/36897508:OOPSLA2(1108-1134)Online publication date: 8-Oct-2024
  • (2024)Coeffects for MiniJava: Cf-MjProceedings of the 26th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3678721.3686232(30-36)Online publication date: 20-Sep-2024
  • (2024)Oxidizing OCaml with Modal Memory ManagementProceedings of the ACM on Programming Languages10.1145/36746428:ICFP(485-514)Online publication date: 15-Aug-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '14: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming
August 2014
390 pages
ISBN:9781450328739
DOI:10.1145/2628136
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 August 2014

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. coeffects
  2. context
  3. indexed comonads
  4. types

Qualifiers

  • Research-article

Funding Sources

  • CHESS

Conference

ICFP'14
Sponsor:

Acceptance Rates

ICFP '14 Paper Acceptance Rate 28 of 85 submissions, 33%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)57
  • Downloads (Last 6 weeks)13
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Effects and Coeffects in Call-by-Push-ValueProceedings of the ACM on Programming Languages10.1145/36897508:OOPSLA2(1108-1134)Online publication date: 8-Oct-2024
  • (2024)Coeffects for MiniJava: Cf-MjProceedings of the 26th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3678721.3686232(30-36)Online publication date: 20-Sep-2024
  • (2024)Oxidizing OCaml with Modal Memory ManagementProceedings of the ACM on Programming Languages10.1145/36746428:ICFP(485-514)Online publication date: 15-Aug-2024
  • (2024)Functional Ownership through Fractional UniquenessProceedings of the ACM on Programming Languages10.1145/36498488:OOPSLA1(1040-1070)Online publication date: 29-Apr-2024
  • (2024)Qualifying System F<:: Some Terms and Conditions May ApplyProceedings of the ACM on Programming Languages10.1145/36498328:OOPSLA1(583-612)Online publication date: 29-Apr-2024
  • (2024)Non-Linear Communication via Graded Modal Session TypesInformation and Computation10.1016/j.ic.2024.105234(105234)Online publication date: Nov-2024
  • (2023)Resource-Aware Soundness for Big-Step SemanticsProceedings of the ACM on Programming Languages10.1145/36228437:OOPSLA2(1281-1309)Online publication date: 16-Oct-2023
  • (2023)Capturing TypesACM Transactions on Programming Languages and Systems10.1145/361800345:4(1-52)Online publication date: 20-Nov-2023
  • (2023)A Graded Modal Dependent Type Theory with a Universe and Erasure, FormalizedProceedings of the ACM on Programming Languages10.1145/36078627:ICFP(920-954)Online publication date: 31-Aug-2023
  • (2023)Monitoring for Resource-AwarenessProceedings of the 6th International Workshop on Verification and Monitoring at Runtime Execution10.1145/3605159.3605856(13-16)Online publication date: 18-Jul-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media