{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,16]],"date-time":"2026-07-16T05:47:57Z","timestamp":1784180877780,"version":"3.55.0"},"publisher-location":"Cham","reference-count":36,"publisher":"Springer International Publishing","isbn-type":[{"value":"9783030993351","type":"print"},{"value":"9783030993368","type":"electronic"}],"license":[{"start":{"date-parts":[[2022,1,1]],"date-time":"2022-01-01T00:00:00Z","timestamp":1640995200000},"content-version":"tdm","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"},{"start":{"date-parts":[[2022,3,29]],"date-time":"2022-03-29T00:00:00Z","timestamp":1648512000000},"content-version":"vor","delay-in-days":87,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"}],"content-domain":{"domain":["link.springer.com"],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2022]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>Regions are a useful tool for the safe and automatic management of resources. Due to their scarcity, resources are often limited in their lifetime which is associated with a certain scope. When control flow leaves the scope, the resources are released. Exceptions can non-locally exit such scopes and it is important that resources are also released in this case.<\/jats:p><jats:p>Continuation-passing style is a useful compiler intermediate language that makes control flow explicit. All calls are tail calls and the runtime stack is not used. It can also serve as an implementation technique for control effects like exceptions. In this case throwing an exception means jumping to a continuation which is not the current one.<\/jats:p><jats:p>How is it possible to offer region-based resource management and exceptions in the same language and translate both to continuation-passing style? In this paper, we answer this question. We present a typed language with resources and exceptions, and its translation to continuation-passing style. The translation can be defined modularly for resources and exceptions \u2013 the correct interaction between the two automatically arises from simple composition. We prove that the translation preserves well-typedness and semantics.<\/jats:p>","DOI":"10.1007\/978-3-030-99336-8_18","type":"book-chapter","created":{"date-parts":[[2022,3,28]],"date-time":"2022-03-28T20:02:48Z","timestamp":1648497768000},"page":"492-519","update-policy":"https:\/\/doi.org\/10.1007\/springer_crossmark_policy","source":"Crossref","is-referenced-by-count":4,"title":["Region-based Resource Management and Lexical Exception Handlers in Continuation-Passing Style"],"prefix":"10.1007","author":[{"given":"Philipp","family":"Schuster","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jonathan Immanuel","family":"Brachth\u00e4user","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Klaus","family":"Ostermann","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"297","published-online":{"date-parts":[[2022,3,29]]},"reference":[{"key":"18_CR1","doi-asserted-by":"crossref","unstructured":"Ahman, D., Bauer, A.: Runners in action. In: M\u00fcller, P. (ed.) Programming Languages and Systems, pp. 29\u201355, Springer International Publishing, Cham (2020)","DOI":"10.1007\/978-3-030-44914-8_2"},{"key":"18_CR2","unstructured":"Appel, A.W.: Compiling with Continuations. Cambridge University Press, New York, NY, USA (1992), ISBN 0-521-41695-7"},{"key":"18_CR3","doi-asserted-by":"crossref","unstructured":"Bertot, Y., Cast\u00e9ran, P.: Interactive Theorem Proving and Program Development, Coq\u2019Art:The Calculus of Inductive Constructions. Springer-Verlag (2004)","DOI":"10.1007\/978-3-662-07964-5"},{"key":"18_CR4","doi-asserted-by":"crossref","unstructured":"Biernacki, D., Pir\u00f3g, M., Polesiuk, P., Sieczkowski, F.: Abstracting algebraic effects. Proc. ACM Program. Lang. 3(POPL), 6:1\u20136:28 (Jan 2019)","DOI":"10.1145\/3290319"},{"key":"18_CR5","doi-asserted-by":"publisher","unstructured":"Biernacki, D., Pir\u00f3g, M., Polesiuk, P., Sieczkowski, F.: Binders by day, labels by night: Effect instances via lexically scoped handlers. Proc. ACM Program. Lang. 4(POPL) (Dec 2019), https:\/\/doi.org\/10.1145\/3371116","DOI":"10.1145\/3371116"},{"key":"18_CR6","doi-asserted-by":"publisher","unstructured":"Brachth\u00e4user, J.I., Schuster, P., Ostermann, K.: Effects as capabilities: Effect handlers and lightweight effect polymorphism. Proc. ACM Program. Lang. 4(OOPSLA) (Nov 2020), https:\/\/doi.org\/10.1145\/3428194","DOI":"10.1145\/3428194"},{"key":"18_CR7","unstructured":"Brady, E.: Idris 2: Quantitative type theory in action. Tech. rep., University of St Andrews, Scotland, UK (2020), URL https:\/\/www.type-driven.org.uk\/edwinb\/papers\/idris2.pdf"},{"key":"18_CR8","doi-asserted-by":"publisher","unstructured":"Cong, Y., Osvald, L., Essertel, G.M., Rompf, T.: Compiling with continuations, or without? whatever. Proc. ACM Program. Lang. 3(ICFP), 79:1\u201379:28 (Jul 2019), https:\/\/doi.org\/10.1145\/3341643","DOI":"10.1145\/3341643"},{"key":"18_CR9","doi-asserted-by":"publisher","unstructured":"Crary, K., Walker, D., Morrisett, G.: Typed memory management in a calculus of capabilities. In: Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, p. 262\u2013275, POPL \u201999, Association for Computing Machinery, New York, NY, USA (1999), https:\/\/doi.org\/10.1145\/292540.292564","DOI":"10.1145\/292540.292564"},{"key":"18_CR10","unstructured":"Danvy, O.: On evaluation contexts, continuations, and the rest of computation (02 2004)"},{"key":"18_CR11","doi-asserted-by":"crossref","unstructured":"Danvy, O., Filinski, A.: Abstracting control. In: Proceedings of the Conference on LISP and Functional Programming, pp. 151\u2013160, ACM, New York, NY, USA (1990)","DOI":"10.1145\/91556.91622"},{"key":"18_CR12","doi-asserted-by":"publisher","unstructured":"Fluet, M., Morrisett, G.: Monadic regions. In: Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming, p. 103\u2013114, ICFP \u201904, Association for Computing Machinery, New York, NY, USA (2004), https:\/\/doi.org\/10.1145\/1016850.1016867","DOI":"10.1145\/1016850.1016867"},{"key":"18_CR13","doi-asserted-by":"crossref","unstructured":"Fluet, M., Morrisett, G., Ahmed, A.: Linear regions are all you need. In: Sestoft, P. (ed.) Programming Languages and Systems, pp. 7\u201321, Springer Berlin Heidelberg, Berlin, Heidelberg (2006)","DOI":"10.1007\/11693024_2"},{"key":"18_CR14","doi-asserted-by":"publisher","unstructured":"Grossman, D., Morrisett, G., Jim, T., Hicks, M., Wang, Y., Cheney, J.: Region-based memory management in cyclone. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, p. 282\u2013293, PLDI \u201902, Association for Computing Machinery, New York, NY, USA (2002), https:\/\/doi.org\/10.1145\/512529.512563","DOI":"10.1145\/512529.512563"},{"key":"18_CR15","unstructured":"Hillerstr\u00f6m, D., Lindley, S., Atkey, B., Sivaramakrishnan, K.: Continuation passing style for effect handlers. In: Formal Structures for Computation and Deduction, LIPIcs, vol.\u00a084, Schloss Dagstuhl\u2013Leibniz-Zentrum f\u00fcr Informatik (2017)"},{"key":"18_CR16","doi-asserted-by":"publisher","unstructured":"Hillerstr\u00f6m, D., Lindley, S., Atkey, R.: Effect handlers via generalised continuations. Journal of Functional Programming 30, e5 (2020), https:\/\/doi.org\/10.1017\/S0956796820000040","DOI":"10.1017\/S0956796820000040"},{"key":"18_CR17","doi-asserted-by":"crossref","unstructured":"Kennedy, A.: Compiling with continuations, continued. In: Proceedings of the International Conference on Functional Programming, pp. 177\u2013190, ACM, New York, NY, USA (2007)","DOI":"10.1145\/1291220.1291179"},{"key":"18_CR18","doi-asserted-by":"crossref","unstructured":"Kiselyov, O., Ishii, H.: Freer monads, more extensible effects. In: Proceedings of the Haskell Symposium, pp. 94\u2013105, ACM, New York, NY, USA (2015)","DOI":"10.1145\/2804302.2804319"},{"key":"18_CR19","doi-asserted-by":"crossref","unstructured":"Kiselyov, O., Shan, C.c.: Lightweight monadic regions. In: Proceedings of the Haskell Symposium, Haskell \u201908, ACM, New York, NY, USA (2008)","DOI":"10.1145\/1411286.1411288"},{"key":"18_CR20","doi-asserted-by":"publisher","unstructured":"Launchbury, J., Peyton\u00a0Jones, S.L.: Lazy functional state threads. In: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, p. 24\u201335, PLDI \u201994, Association for Computing Machinery, New York, NY, USA (1994), https:\/\/doi.org\/10.1145\/178243.178246","DOI":"10.1145\/178243.178246"},{"key":"18_CR21","unstructured":"Leijen, D.: Algebraic effect handlers with resources and deep finalization. Tech. Rep. MSR-TR-2018-10, Microsoft Research (April 2018)"},{"key":"18_CR22","doi-asserted-by":"crossref","unstructured":"Levy, P.B., Power, J., Thielecke, H.: Modelling environments in call-by-value programming languages. Information and Computation 185(2), 182\u2013210 (2003)","DOI":"10.1016\/S0890-5401(03)00088-9"},{"key":"18_CR23","doi-asserted-by":"crossref","unstructured":"Moggi, E., Sabry, A.: Monadic encapsulation of effects: a revised approach (extended version). Journal of Functional Programming 11(6), 591\u2013627 (Nov 2001)","DOI":"10.1017\/S0956796801004154"},{"key":"18_CR24","doi-asserted-by":"crossref","unstructured":"Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proceedings of the ACM annual conference, pp. 717\u2013740, ACM, New York, NY, USA (1972)","DOI":"10.1145\/800194.805852"},{"key":"18_CR25","doi-asserted-by":"publisher","unstructured":"Schuster, P., Brachth\u00e4user, J.I.: Typing, representing, and abstracting control. In: Proceedings of the Workshop on Type-Driven Development, pp. 14\u201324, ACM, New York, NY, USA (2018), https:\/\/doi.org\/10.1145\/3240719.3241788","DOI":"10.1145\/3240719.3241788"},{"key":"18_CR26","doi-asserted-by":"publisher","unstructured":"Schuster, P., Brachth\u00e4user, J.I., Ostermann, K.: Compiling effect handlers in capability-passing style. Proc. ACM Program. Lang. 4(ICFP) (Aug 2020), https:\/\/doi.org\/10.1145\/3408975","DOI":"10.1145\/3408975"},{"key":"18_CR27","doi-asserted-by":"crossref","unstructured":"Schuster, P., Brachth\u00e4user, J.I., Ostermann, K.: Region-based resource management and lexical exception handlers in continuation-passing style (technical report). Tech. rep., University of T\u00fcbingen, Germany (01 2022), https:\/\/se.informatik.uni-tuebingen.de\/publications\/schuster22region\/","DOI":"10.1007\/978-3-030-99336-8_18"},{"key":"18_CR28","doi-asserted-by":"publisher","unstructured":"Semmelroth, M., Sabry, A.: Monadic encapsulation in ml. In: Proceedings of the Fourth ACM SIGPLAN International Conference on Functional Programming, p. 8\u201317, ICFP \u201999, Association for Computing Machinery, New York, NY, USA (1999), https:\/\/doi.org\/10.1145\/317636.317777","DOI":"10.1145\/317636.317777"},{"key":"18_CR29","doi-asserted-by":"publisher","unstructured":"Thielecke, H.: Comparing control constructs by double-barrelled cps. Higher Order Symbol. Comput. 15(2\u20133), 141\u2013160 (sep 2002), https:\/\/doi.org\/10.1023\/A:1020887011500","DOI":"10.1023\/A:1020887011500"},{"key":"18_CR30","doi-asserted-by":"publisher","unstructured":"Thielecke, H.: From control effects to typed continuation passing. In: Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, p. 139\u2013149, POPL \u201903, Association for Computing Machinery, New York, NY, USA (2003), https:\/\/doi.org\/10.1145\/604131.604144","DOI":"10.1145\/604131.604144"},{"key":"18_CR31","doi-asserted-by":"publisher","unstructured":"Timany, A., Stefanesco, L., Krogh-Jespersen, M., Birkedal, L.: A logical relation for monadic encapsulation of state: Proving contextual equivalences in the presence of runst. Proc. ACM Program. Lang. 2(POPL) (Dec 2017), https:\/\/doi.org\/10.1145\/3158152","DOI":"10.1145\/3158152"},{"key":"18_CR32","unstructured":"Tofte, M., Birkedal, L., Elsman, M., Hallenberg, N., Sestoft, P.: Programming with regions in the ml kit (for version 4) (10 2001)"},{"key":"18_CR33","doi-asserted-by":"publisher","unstructured":"Tofte, M., Talpin, J.P.: Region-based memory management. Inf. Comput. 132(2), 109\u2013176 (Feb 1997), https:\/\/doi.org\/10.1006\/inco.1996.2613","DOI":"10.1006\/inco.1996.2613"},{"key":"18_CR34","doi-asserted-by":"publisher","unstructured":"Xie, N., Brachth\u00e4user, J.I., Hillerstr\u00f6m, D., Schuster, P., Leijen, D.: Effect handlers, evidently. Proc. ACM Program. Lang. 4(ICFP) (Aug 2020), https:\/\/doi.org\/10.1145\/3408981","DOI":"10.1145\/3408981"},{"key":"18_CR35","doi-asserted-by":"crossref","unstructured":"Zhang, Y., Myers, A.C.: Abstraction-safe effect handlers via tunneling. Proc. ACM Program. Lang. 3(POPL), 5:1\u20135:29 (Jan 2019)","DOI":"10.1145\/3290318"},{"key":"18_CR36","doi-asserted-by":"crossref","unstructured":"Zhang, Y., Salvaneschi, G., Beightol, Q., Liskov, B., Myers, A.C.: Accepting blame for safe tunneled exceptions. In: Proceedings of the Conference on Programming Language Design and Implementation, pp. 281\u2013295, ACM, New York, NY, USA (2016)","DOI":"10.1145\/2980983.2908086"}],"container-title":["Lecture Notes in Computer Science","Programming Languages and Systems"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/978-3-030-99336-8_18","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2024,11,15]],"date-time":"2024-11-15T05:09:15Z","timestamp":1731647355000},"score":1,"resource":{"primary":{"URL":"https:\/\/link.springer.com\/10.1007\/978-3-030-99336-8_18"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022]]},"ISBN":["9783030993351","9783030993368"],"references-count":36,"URL":"https:\/\/doi.org\/10.1007\/978-3-030-99336-8_18","relation":{},"ISSN":["0302-9743","1611-3349"],"issn-type":[{"value":"0302-9743","type":"print"},{"value":"1611-3349","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022]]},"assertion":[{"value":"29 March 2022","order":1,"name":"first_online","label":"First Online","group":{"name":"ChapterHistory","label":"Chapter History"}},{"value":"ESOP","order":1,"name":"conference_acronym","label":"Conference Acronym","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"European Symposium on Programming","order":2,"name":"conference_name","label":"Conference Name","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"Munich","order":3,"name":"conference_city","label":"Conference City","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"Germany","order":4,"name":"conference_country","label":"Conference Country","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"2022","order":5,"name":"conference_year","label":"Conference Year","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"5 April 2022","order":7,"name":"conference_start_date","label":"Conference Start Date","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"7 April 2022","order":8,"name":"conference_end_date","label":"Conference End Date","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"31","order":9,"name":"conference_number","label":"Conference Number","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"esop2022","order":10,"name":"conference_id","label":"Conference ID","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"https:\/\/etaps.org\/2022\/esop","order":11,"name":"conference_url","label":"Conference URL","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"Double-blind","order":1,"name":"type","label":"Type","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"HotCRP","order":2,"name":"conference_management_system","label":"Conference Management System","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"64","order":3,"name":"number_of_submissions_sent_for_review","label":"Number of Submissions Sent for Review","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"21","order":4,"name":"number_of_full_papers_accepted","label":"Number of Full Papers Accepted","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"0","order":5,"name":"number_of_short_papers_accepted","label":"Number of Short Papers Accepted","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"33% - The value is computed by the equation \"Number of Full Papers Accepted \/ Number of Submissions Sent for Review * 100\" and then rounded to a whole number.","order":6,"name":"acceptance_rate_of_full_papers","label":"Acceptance Rate of Full Papers","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"3.5","order":7,"name":"average_number_of_reviews_per_paper","label":"Average Number of Reviews per Paper","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"7","order":8,"name":"average_number_of_papers_per_reviewer","label":"Average Number of Papers per Reviewer","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}},{"value":"Yes","order":9,"name":"external_reviewers_involved","label":"External Reviewers Involved","group":{"name":"ConfEventPeerReviewInformation","label":"Peer Review Information (provided by the conference organizers)"}}]}}