{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,18]],"date-time":"2026-08-18T14:46:41Z","timestamp":1787064401352,"version":"build-2736575974"},"reference-count":37,"publisher":"Association for Computing Machinery (ACM)","issue":"OOPSLA2","license":[{"start":{"date-parts":[[2023,10,16]],"date-time":"2023-10-16T00:00:00Z","timestamp":1697414400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"NSF","award":["CCF-210228"],"award-info":[{"award-number":["CCF-210228"]}]},{"name":"UKRI","award":["MR\/T043830\/1"],"award-info":[{"award-number":["MR\/T043830\/1"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2023,10,16]]},"abstract":"<jats:p>WebAssembly (Wasm) is a low-level portable code format offering near  \nnative performance. It is intended as a compilation target for a wide  \nvariety of source languages. However, Wasm provides no direct support  \nfor non-local control flow features such as async\/await,  \ngenerators\/iterators, lightweight threads, first-class continuations,  \netc. This means that compilers for source languages with such features  \nmust ceremoniously transform whole source programs in order to target  \nWasm.<\/jats:p>\n                  <jats:p>We present WasmFX an extension to Wasm which provides a universal  \ntarget for non-local control features via effect handlers, enabling  \ncompilers to translate such features directly into Wasm. Our  \nextension is minimal and only adds three main instructions for  \ncreating, suspending, and resuming continuations. Moreover, our  \nprimitive instructions are type-safe providing typed continuations  \nwhich are well-aligned with the design principles of Wasm whose stacks  \nare typed. We present a formal specification of WasmFX and show that  \nthe extension is sound. We have implemented WasmFX as an extension to  \nthe Wasm reference interpreter and also built a prototype WasmFX  \nextension for Wasmtime, a production-grade Wasm engine, piggybacking  \non Wasmtime's existing fibers API. The preliminary performance  \nresults for our prototype are encouraging, and we outline future plans  \nto realise a native implementation.<\/jats:p>","DOI":"10.1145\/3622814","type":"journal-article","created":{"date-parts":[[2023,10,16]],"date-time":"2023-10-16T11:41:29Z","timestamp":1697456489000},"page":"460-485","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":19,"title":["Continuing WebAssembly with Effect Handlers"],"prefix":"10.1145","volume":"7","author":[{"ORCID":"https:\/\/orcid.org\/0009-0001-4398-6987","authenticated-orcid":false,"given":"Luna","family":"Phipps-Costin","sequence":"first","affiliation":[{"name":"Northeastern University, Boston, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3137-3160","authenticated-orcid":false,"given":"Andreas","family":"Rossberg","sequence":"additional","affiliation":[{"name":"Independent, Munich, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7493-3271","authenticated-orcid":false,"given":"Arjun","family":"Guha","sequence":"additional","affiliation":[{"name":"Northeastern University, Boston, USA \/ Roblox, Boston, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-1027-5430","authenticated-orcid":false,"given":"Daan","family":"Leijen","sequence":"additional","affiliation":[{"name":"Microsoft Research, Redmond, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4730-9315","authenticated-orcid":false,"given":"Daniel","family":"Hillerstr\u00f6m","sequence":"additional","affiliation":[{"name":"Huawei Zurich Research Center, Zurich, Switzerland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3491-1780","authenticated-orcid":false,"given":"KC","family":"Sivaramakrishnan","sequence":"additional","affiliation":[{"name":"Tarides, Chennai, India \/ IIT Madras, Chennai, India"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-7755-2303","authenticated-orcid":false,"given":"Matija","family":"Pretnar","sequence":"additional","affiliation":[{"name":"University of Ljubljana, Ljubljana, Slovenia \/ Institute of Mathematics, Physics &amp; Mechanics, Ljubljana, Slovenia"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-1360-4714","authenticated-orcid":false,"given":"Sam","family":"Lindley","sequence":"additional","affiliation":[{"name":"The University of Edinburgh, Edinburgh, United Kingdom"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2023,10,16]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"Heejin Ahn. 2022. Exception Handling Proposal for WebAssembly. https:\/\/webassembly.github.io\/exception-handling\/ Accessed 2022-10-27 \t\t\t\t  Heejin Ahn. 2022. Exception Handling Proposal for WebAssembly. https:\/\/webassembly.github.io\/exception-handling\/ Accessed 2022-10-27"},{"key":"e_1_2_1_2_1","volume-title":"Concurrent Programming in Erlang","author":"Armstrong Joe","unstructured":"Joe Armstrong , Robert Virding , Claes Wikstr\u00f6m , and Mike Williams . 1996. Concurrent Programming in Erlang , Second Edition. Prentice Hall International , Hertfordshire, UK . Joe Armstrong, Robert Virding, Claes Wikstr\u00f6m, and Mike Williams. 1996. Concurrent Programming in Erlang, Second Edition. Prentice Hall International, Hertfordshire, UK."},{"key":"e_1_2_1_3_1","unstructured":"Alan Bateman and Ron Pressler. 2021. JEP 428: Structured Concurrency (Incubator). https:\/\/openjdk.org\/jeps\/428 Accessed 2023-04-14 \t\t\t\t  Alan Bateman and Ron Pressler. 2021. JEP 428: Structured Concurrency (Incubator). https:\/\/openjdk.org\/jeps\/428 Accessed 2023-04-14"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796801004099"},{"key":"e_1_2_1_5_1","volume-title":"ECOOP (Lecture Notes in Computer Science","volume":"257","author":"Bierman Gavin M.","year":"2012","unstructured":"Gavin M. Bierman , Claudio V. Russo , Geoffrey Mainland , Erik Meijer , and Mads Torgersen . 2012 . Pause \u2019n\u2019 Play: Formalizing Asynchronous C# . In ECOOP (Lecture Notes in Computer Science , Vol. 7313). Springer, 233\u2013 257 . Gavin M. Bierman, Claudio V. Russo, Geoffrey Mainland, Erik Meijer, and Mads Torgersen. 2012. Pause \u2019n\u2019 Play: Formalizing Asynchronous C#. In ECOOP (Lecture Notes in Computer Science, Vol. 7313). Springer, 233\u2013257."},{"key":"e_1_2_1_6_1","doi-asserted-by":"crossref","unstructured":"Carl Bruggeman Oscar Waddell and R. Kent Dybvig. 1996. Representing Control in the Presence of One-Shot Continuations. In PLDI. ACM 99\u2013107. \t\t\t\t  Carl Bruggeman Oscar Waddell and R. Kent Dybvig. 1996. Representing Control in the Presence of One-Shot Continuations. In PLDI. ACM 99\u2013107.","DOI":"10.1145\/249069.231395"},{"key":"e_1_2_1_7_1","unstructured":"Alex Crichton. 2021. Wasmtime Fiber API. https:\/\/docs.wasmtime.dev\/api\/wasmtime_fiber\/index.html Accessed 2023-04-14 \t\t\t\t  Alex Crichton. 2021. Wasmtime Fiber API. https:\/\/docs.wasmtime.dev\/api\/wasmtime_fiber\/index.html Accessed 2023-04-14"},{"key":"e_1_2_1_8_1","volume-title":"Reppy","author":"Farvardin Kavon","year":"2020","unstructured":"Kavon Farvardin and John H . Reppy . 2020 . From folklore to fact: comparing implementations of stacks and continuations. In PLDI. ACM , 75\u201390. Kavon Farvardin and John H. Reppy. 2020. From folklore to fact: comparing implementations of stacks and continuations. In PLDI. ACM, 75\u201390."},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3385412.3385981"},{"key":"e_1_2_1_10_1","volume-title":"Proc. ACM Program. Lang., 6, OOPSLA2","author":"Ghica Dan R.","year":"2022","unstructured":"Dan R. Ghica , Sam Lindley , Marcos Maro\u00f1as Bravo , and Maciej Pir\u00f3g . 2022 . High-level effect handlers in C++ . Proc. ACM Program. Lang., 6, OOPSLA2 (2022), 1639\u20131667. Dan R. Ghica, Sam Lindley, Marcos Maro\u00f1as Bravo, and Maciej Pir\u00f3g. 2022. High-level effect handlers in C++. Proc. ACM Program. Lang., 6, OOPSLA2 (2022), 1639\u20131667."},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/224164.224173"},{"key":"e_1_2_1_12_1","doi-asserted-by":"crossref","first-page":"185","DOI":"10.1145\/3140587.3062363","article-title":"Bringing the Web up to Speed with WebAssembly","volume":"52","author":"Haas Andreas","year":"2017","unstructured":"Andreas Haas , Andreas Rossberg , Derek Schuff , Ben Titzer , Michael Holman , Dan Gohman , Luke Wagner , Alon Zakai , and J.F. Bastien . 2017 . Bringing the Web up to Speed with WebAssembly . SIGPLAN Notices , 52 , 6 (2017), June , 185 \u2013 200 . Andreas Haas, Andreas Rossberg, Derek Schuff, Ben Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and J.F. Bastien. 2017. Bringing the Web up to Speed with WebAssembly. SIGPLAN Notices, 52, 6 (2017), June, 185\u2013200.","journal-title":"SIGPLAN Notices"},{"key":"e_1_2_1_13_1","volume-title":"APLAS (Lecture Notes in Computer Science","volume":"435","author":"Hillerstr\u00f6m Daniel","year":"2018","unstructured":"Daniel Hillerstr\u00f6m and Sam Lindley . 2018 . Shallow Effect Handlers . In APLAS (Lecture Notes in Computer Science , Vol. 11275). Springer, 415\u2013 435 . Daniel Hillerstr\u00f6m and Sam Lindley. 2018. Shallow Effect Handlers. In APLAS (Lecture Notes in Computer Science, Vol. 11275). Springer, 415\u2013435."},{"key":"e_1_2_1_14_1","volume-title":"Foundations for Programming and Implementing Effect Handlers. Ph. D. Dissertation. School of Informatics","author":"Hillerstr\u00f6m Daniel","unstructured":"Daniel Hillerstr\u00f6m . 2021. Foundations for Programming and Implementing Effect Handlers. Ph. D. Dissertation. School of Informatics , The University of Edinburgh, Scotland , UK. Daniel Hillerstr\u00f6m. 2021. Foundations for Programming and Implementing Effect Handlers. Ph. D. Dissertation. School of Informatics, The University of Edinburgh, Scotland, UK."},{"key":"e_1_2_1_15_1","doi-asserted-by":"crossref","unstructured":"Ohad Kammar Sam Lindley and Nicolas Oury. 2013. Handlers in action. In ICFP. ACM 145\u2013158. \t\t\t\t  Ohad Kammar Sam Lindley and Nicolas Oury. 2013. Handlers in action. In ICFP. ACM 145\u2013158.","DOI":"10.1145\/2544174.2500590"},{"key":"e_1_2_1_16_1","unstructured":"Oleg Kiselyov. 2012. An argument against call\/cc. https:\/\/okmij.org\/ftp\/continuations\/against-callcc.html Accessed 2023-04-12 \t\t\t\t  Oleg Kiselyov. 2012. An argument against call\/cc. https:\/\/okmij.org\/ftp\/continuations\/against-callcc.html Accessed 2023-04-12"},{"key":"e_1_2_1_17_1","unstructured":"KJP. 2019. Benchmarking 1 million C# tasks vs Go goroutines: Is there any difference? https:\/\/karl-pickett.medium.com\/benchmarking-a-toy-c-task-vs-a-go-goroutine-is-there-any-difference-248f73f7f7b7 \t\t\t\t  KJP. 2019. Benchmarking 1 million C# tasks vs Go goroutines: Is there any difference? https:\/\/karl-pickett.medium.com\/benchmarking-a-toy-c-task-vs-a-go-goroutine-is-there-any-difference-248f73f7f7b7"},{"key":"e_1_2_1_18_1","unstructured":"Daan Leijen and KC Sivaramakrishnan. 2021. libmprompt. https:\/\/github.com\/koka-lang\/libmprompt Accessed 2023-04-14 \t\t\t\t  Daan Leijen and KC Sivaramakrishnan. 2021. libmprompt. https:\/\/github.com\/koka-lang\/libmprompt Accessed 2023-04-14"},{"key":"e_1_2_1_19_1","volume-title":"APLAS (Lecture Notes in Computer Science","volume":"265","author":"Leijen Daan","year":"2019","unstructured":"Daan Leijen , Benjamin Zorn , and Leonardo de Moura . 2019 . Mimalloc: Free List Sharding in Action . In APLAS (Lecture Notes in Computer Science , Vol. 11893). Springer, 244\u2013 265 . Daan Leijen, Benjamin Zorn, and Leonardo de Moura. 2019. Mimalloc: Free List Sharding in Action. In APLAS (Lecture Notes in Computer Science, Vol. 11893). Springer, 244\u2013265."},{"key":"e_1_2_1_20_1","unstructured":"Bob Nystrom. 2015. What Color is Your Function? https:\/\/journal.stuffwithstuff.com\/2015\/02\/01\/what-color-is-your-function\/ \t\t\t\t  Bob Nystrom. 2015. What Color is Your Function? https:\/\/journal.stuffwithstuff.com\/2015\/02\/01\/what-color-is-your-function\/"},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.8332962"},{"key":"e_1_2_1_22_1","doi-asserted-by":"crossref","unstructured":"Donald Pinckney Arjun Guha and Yuriy Brun. 2020. Wasm\/k: delimited continuations for WebAssembly. In DLS. ACM 16\u201328. \t\t\t\t  Donald Pinckney Arjun Guha and Yuriy Brun. 2020. Wasm\/k: delimited continuations for WebAssembly. In DLS. ACM 16\u201328.","DOI":"10.1145\/3426422.3426978"},{"key":"e_1_2_1_23_1","volume-title":"Plotkin and Matija Pretnar","author":"Gordon","year":"2009","unstructured":"Gordon D. Plotkin and Matija Pretnar . 2009 . Handlers of Algebraic Effects. In ESOP (Lecture Notes in Computer Science , Vol. 5502). Springer, 80\u2013 94 . Gordon D. Plotkin and Matija Pretnar. 2009. Handlers of Algebraic Effects. In ESOP (Lecture Notes in Computer Science, Vol. 5502). Springer, 80\u201394."},{"key":"e_1_2_1_24_1","volume-title":"Plotkin and Matija Pretnar","author":"Gordon","year":"2013","unstructured":"Gordon D. Plotkin and Matija Pretnar . 2013 . Handling Algebraic Effects. Log. Methods Comput. Sci ., 9, 4 (2013). Gordon D. Plotkin and Matija Pretnar. 2013. Handling Algebraic Effects. Log. Methods Comput. Sci., 9, 4 (2013)."},{"key":"e_1_2_1_25_1","volume-title":"Project Loom: Fibers and Continuations for the Java Virtual Machine. https:\/\/cr.openjdk.org\/ rpressler\/loom\/Loom-Proposal.html Accessed 2023-04-14","author":"Pressler Ron","year":"2018","unstructured":"Ron Pressler . 2018 . Project Loom: Fibers and Continuations for the Java Virtual Machine. https:\/\/cr.openjdk.org\/ rpressler\/loom\/Loom-Proposal.html Accessed 2023-04-14 Ron Pressler. 2018. Project Loom: Fibers and Continuations for the Java Virtual Machine. https:\/\/cr.openjdk.org\/ rpressler\/loom\/Loom-Proposal.html Accessed 2023-04-14"},{"key":"e_1_2_1_26_1","unstructured":"Andreas Rossberg. 2019. WebAssembly (Release 1.0). https:\/\/webassembly.github.io\/spec\/ Accessed 2020-01-01 \t\t\t\t  Andreas Rossberg. 2019. WebAssembly (Release 1.0). https:\/\/webassembly.github.io\/spec\/ Accessed 2020-01-01"},{"key":"e_1_2_1_27_1","unstructured":"Andreas Rossberg. 2022. Function Reference Types Proposal for WebAssembly. https:\/\/webassembly.github.io\/function-references\/ Accessed 2022-10-27 \t\t\t\t  Andreas Rossberg. 2022. Function Reference Types Proposal for WebAssembly. https:\/\/webassembly.github.io\/function-references\/ Accessed 2022-10-27"},{"key":"e_1_2_1_28_1","unstructured":"Andreas Rossberg. 2023. WebAssembly (Release 2.0). https:\/\/webassembly.github.io\/spec\/ Accessed 2023-20-02 \t\t\t\t  Andreas Rossberg. 2023. WebAssembly (Release 2.0). https:\/\/webassembly.github.io\/spec\/ Accessed 2023-20-02"},{"key":"e_1_2_1_29_1","doi-asserted-by":"crossref","unstructured":"Dorai Sitaram. 1993. Handling Control. In PLDI. ACM 147\u2013155. \t\t\t\t  Dorai Sitaram. 1993. Handling Control. In PLDI. ACM 147\u2013155.","DOI":"10.1145\/173262.155104"},{"key":"e_1_2_1_30_1","doi-asserted-by":"crossref","unstructured":"K. C. Sivaramakrishnan Stephen Dolan Leo White Tom Kelly Sadiq Jaffer and Anil Madhavapeddy. 2021. Retrofitting effect handlers onto OCaml. In PLDI. ACM 206\u2013221. \t\t\t\t  K. C. Sivaramakrishnan Stephen Dolan Leo White Tom Kelly Sadiq Jaffer and Anil Madhavapeddy. 2021. Retrofitting effect handlers onto OCaml. In PLDI. ACM 206\u2013221.","DOI":"10.1145\/3453483.3454039"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796809990074"},{"key":"e_1_2_1_32_1","volume-title":"Common LISP: The Language","author":"Steele Guy L.","unstructured":"Guy L. Steele Jr .. 1990. Common LISP: The Language ( 2 nd Ed.). Digital Press . Guy L. Steele Jr.. 1990. Common LISP: The Language (2nd Ed.). Digital Press.","edition":"2"},{"key":"e_1_2_1_33_1","volume-title":"Formal Methods: 24th International Symposium. Springer-Verlag","author":"Watt Conrad","year":"2021","unstructured":"Conrad Watt , Xiaojia Rao , Jean Pichon-Pharabod , Martin Rao , and Philippa Gardner . 2021 . Two Mechanisations of WebAssembly 1.0 . In Formal Methods: 24th International Symposium. Springer-Verlag , Berlin, Germany. 61\u201379. Conrad Watt, Xiaojia Rao, Jean Pichon-Pharabod, Martin Rao, and Philippa Gardner. 2021. Two Mechanisations of WebAssembly 1.0. In Formal Methods: 24th International Symposium. Springer-Verlag, Berlin, Germany. 61\u201379."},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1145\/3563289"},{"key":"e_1_2_1_35_1","volume-title":"Proc. ACM Prog. Lang. (ICFP\u201921)","author":"Xie Ningning","year":"2021","unstructured":"Ningning Xie and Daan Leijen . 2021 . Generalized Evidence Passing for Effect Handlers (or, Efficient Compilation of Effect Handlers to C) . Proc. ACM Prog. Lang. (ICFP\u201921) , 5, ICFP (2021), Aug., 71. https:\/\/www.microsoft.com\/en-us\/research\/publication\/generalized-evidence-passing-for-effect-handlers-or-efficient-compilation-of-effect-handlers-to-c\/ Ningning Xie and Daan Leijen. 2021. Generalized Evidence Passing for Effect Handlers (or, Efficient Compilation of Effect Handlers to C). Proc. ACM Prog. Lang. (ICFP\u201921), 5, ICFP (2021), Aug., 71. https:\/\/www.microsoft.com\/en-us\/research\/publication\/generalized-evidence-passing-for-effect-handlers-or-efficient-compilation-of-effect-handlers-to-c\/"},{"key":"e_1_2_1_36_1","unstructured":"Jeremy Yallop. 2023. A collaborative bibliography of work related to the theory and practice of computational effects. https:\/\/github.com\/yallop\/effects-bibliography Accessed 2023-04-14 \t\t\t\t  Jeremy Yallop. 2023. A collaborative bibliography of work related to the theory and practice of computational effects. https:\/\/github.com\/yallop\/effects-bibliography Accessed 2023-04-14"},{"key":"e_1_2_1_37_1","unstructured":"Alon Zakai. 2019. Pause and Resume WebAssembly with Binaryen\u2019s Asyncify. https:\/\/kripken.github.io\/blog\/wasm\/2019\/07\/16\/asyncify.html Accessed 2022-10-27 \t\t\t\t  Alon Zakai. 2019. Pause and Resume WebAssembly with Binaryen\u2019s Asyncify. https:\/\/kripken.github.io\/blog\/wasm\/2019\/07\/16\/asyncify.html Accessed 2022-10-27"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3622814","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3622814","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T12:37:04Z","timestamp":1750163824000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3622814"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,10,16]]},"references-count":37,"journal-issue":{"issue":"OOPSLA2","published-print":{"date-parts":[[2023,10,16]]}},"alternative-id":["10.1145\/3622814"],"URL":"https:\/\/doi.org\/10.1145\/3622814","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,10,16]]},"assertion":[{"value":"2023-10-16","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}