What You See Is What You Get: Practical Effect Handlers in Capability-Passing Style

8 min read Original article ↗

References

  1. Ahman, D., Pretnar, M.: Asynchronous effects. Proc. ACM Program. Lang. 5(POPL) (2021). https://doi.org/10.1145/3434305

  2. Bauer, A., Pretnar, M.: An effect system for algebraic effects and handlers. In: International Conference on Algebra and Coalgebra in Computer Science, pp. 1–16. Springer, Berlin, Heidelberg (2013)

  3. Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Logical Algebraic Methods Program. 84(1), 108–123 (2015)

  4. Biernacki, D., Piróg, M., Polesiuk, P., Sieczkowski, F.: Abstracting algebraic effects. Proc. ACM Program. Lang. 3(POPL), 6:1–6:28 (2019)

  5. Biernacki, D., Piróg, M., Polesiuk, P., Sieczkowski, F.: Binders by day, labels by night: effect instances via lexically scoped handlers. Proc. ACM Program. Lang. 4(POPL) (2019). https://doi.org/10.1145/3371116

  6. Brachthäuser, J.I., Schuster, P.: Effekt: Extensible algebraic effects in Scala (short paper). In: Proceedings of the International Symposium on Scala. ACM, New York (2017). https://doi.org/10.1145/3136000.3136007

  7. Brachthäuser, J.I., Schuster, P., Ostermann, K.: Effect handlers for the masses. Proc. ACM Program. Lang. 2(OOPSLA), 111:1–111:27 (2018). https://doi.org/10.1145/3276481

  8. Brachthäuser, J.I., Schuster, P., Ostermann, K.: Effects as capabilities: effect handlers and lightweight effect polymorphism. Proc. ACM Program. Lang. 4(OOPSLA) (2020). https://doi.org/10.1145/3428194

  9. Brachthäuser, J.I., Schuster, P., Ostermann, K.: Effekt: capability-passing style for type- and effect-safe, extensible effect handlers in Scala. J. Funct. Program. (2020). https://doi.org/10.1017/S0956796820000027

  10. Brachthäuser, J.I.: Towards naturalistic EDSLs using algebraic effects (2017). Presentation at Domain-Specific Language Design and Implementation (DSLDI)

  11. Brachthäuser, J.I.: Design and implementation of effect handlers for object-oriented programming languages. Ph.D. Thesis, University of Tübingen, Germany (2020). https://doi.org/10.15496/publikation-43400

  12. Brachthäuser, J.I., Leijen, D.: Programming with implicit values, functions, and control. Tech. Rep. MSR-TR-2019-7, Microsoft Research (2019)

  13. Brady, E.: Programming and reasoning with algebraic effects and dependent types. In: Proceedings of the International Conference on Functional Programming, pp. 133–144. ACM, New York (2013)

  14. Convent, L., Lindley, S., McBride, C., McLaughlin, C.: Doo bee doo bee doo. J. Funct. Program. 30, e9 (2020). https://doi.org/10.1017/S0956796820000039

  15. Danvy, O., Filinski, A.: Abstracting control. In: Proceedings of the Conference on LISP and Functional Programming, pp. 151–160. ACM, New York (1990)

  16. Dennis, J.B., Van Horn, E.C.: Programming semantics for multiprogrammed computations. Commun. ACM 9(3), 143–155 (1966)

  17. Dolan, S., Eliopoulos, S., Hillerström, D., Madhavapeddy, A., Sivaramakrishnan, K., White, L.: Concurrent system programming with effect handlers. In: Proceedings of the Symposium on Trends in Functional Programming. Springer LNCS 10788 (2017)

  18. Dolan, S., Eliopoulos, S., Hillerström, D., Madhavapeddy, A., Sivaramakrishnan, K., White, L.: Effectively tackling the awkward squad. In: ML Workshop (2017)

  19. Dolan, S., Muralidharan, S., Gregg, D.: Compiler support for lightweight context switching. ACM Trans. Archit. Code Optim. 9(4), 36:1–36:25 (2013)

  20. Dolan, S., White, L., Madhavapeddy, A.: Multicore OCaml. In: OCaml Workshop (2014)

  21. Dolan, S., White, L., Sivaramakrishnan, K., Yallop, J., Madhavapeddy, A.: Effective concurrency through algebraic effects. In: OCaml Workshop (2015)

  22. Dybvig, R.K.: The development of chez scheme. In: Proceedings of the Eleventh ACM SIGPLAN International Conference on Functional Programming, ICFP ’06, pp. 1–12. ACM, New York (2006). https://doi.org/10.1145/1159803.1159805

  23. Dybvig, R.K., Peyton Jones, S.L., Sabry, A.: A monadic framework for delimited continuations. J. Funct. Program. 17(6), 687–730 (2007)

  24. Fischer, M.J.: Lambda calculus schemata. In: Proceedings of ACM Conference on Proving Assertions About Programs, pp. 104–109. ACM, New York (1972)

  25. Gosling, J., Joy, B., Steele, G.L.: The Java Language Specification. Addison-Wesley Publishing, Boston (1996)

  26. Gunter, C.A., Rémy, D., Riecke, J.G.: A generalization of exceptions and control in ML-like languages. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pp. 12–23. ACM, New York (1995)

  27. Hillerström, D., Lindley, S., Atkey, B., Sivaramakrishnan, K.: Continuation passing style for effect handlers. In: Formal Structures for Computation and Deduction, LIPIcs, vol. 84. Schloss Dagstuhl–Leibniz-Zentrum für Informatik (2017)

  28. Inostroza, P., van der Storm, T.: JEff: Objects for effect. In: Proceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, Onward! 2018. ACM, New York (2018)

  29. Kammar, O., Lindley, S., Oury, N.: Handlers in action. In: Proceedings of the International Conference on Functional Programming, pp. 145–158. ACM, New York (2013)

  30. Kiselyov, O.: Delimited control in OCaml, abstractly and concretely. Theor. Comput. Sci. 435, 56–76 (2012)

  31. Kiselyov, O., Sabry, A., Swords, C.: Extensible effects: an alternative to monad transformers. In: Proceedings of the Haskell Symposium, pp. 59–70. ACM, New York (2013)

  32. Kiselyov, O., Sivaramakrishnan, K.: Eff directly in OCaml. In: ML Workshop (2016)

  33. Leijen, D.: Koka: Programming with row polymorphic effect types. In: Proceedings of the Workshop on Mathematically Structured Functional Programming (2014)

  34. Leijen, D.: Algebraic effects for functional programming. Tech. rep., MSR-TR-2016-29. Microsoft Research technical report (2016)

  35. Leijen, D.: Implementing algebraic effects in C. In: Proceedings of the Asian Symposium on Programming Languages and Systems, pp. 339–363. Springer, Cham (2017)

  36. Leijen, D.: Structured asynchrony with algebraic effects. In: Proceedings of the Workshop on Type-Driven Development, pp. 16–29. ACM, New York (2017)

  37. Leijen, D.: Type directed compilation of row-typed algebraic effects. In: Proceedings of the Symposium on Principles of Programming Languages, pp. 486–499. ACM, New York (2017)

  38. Lewis, J.R., Launchbury, J., Meijer, E., Shields, M.B.: Implicit parameters: dynamic scoping with static types. In: Proceedings of the Symposium on Principles of Programming Languages, pp. 108–118. ACM, New York (2000)

  39. Lindley, S.: Encapsulating effects. Dagstuhl Rep. 8(4), 114–118 (2018)

  40. Lindley, S., McBride, C., McLaughlin, C.: Do be do be do. In: Proceedings of the Symposium on Principles of Programming Languages, pp. 500–514. ACM, New York (2017)

  41. Madsen, M., Lhoták, O., Tip, F.: A model for reasoning about javascript promises. Proc. ACM Program. Lang. 1(OOPSLA) (2017). https://doi.org/10.1145/3133910

  42. McCarthy, J.: Recursive functions of symbolic expressions and their computation by machine, Part I. Commun. ACM 3(4), 184–195 (1960). https://doi.org/10.1145/367177.367199

  43. Melicher, D., Shi, Y., Potanin, A., Aldrich, J.: A capability-based module system for authority control. In: 31st European Conference on Object-Oriented Programming (ECOOP 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2017)

  44. Miller, M.S.: Robust composition: Towards a unified approach to access control and concurrency control. Ph.D. Thesis, Johns Hopkins University, Baltimore, Maryland, USA (2006). AAI3245526

  45. Osvald, L., Essertel, G., Wu, X., Alayón, L.I.G., Rompf, T.: Gentrification gone too far? affordable 2nd-class values for fun and (co-) effect. In: Proceedings of the Conference on Object-Oriented Programming, Systems, Languages and Applications, pp. 234–251. ACM, New York (2016)

  46. Plotkin, G., Power, J.: Algebraic operations and generic effects. Appl. Categorical Struct. 11(1), 69–94 (2003)

  47. Plotkin, G., Pretnar, M.: Handlers of algebraic effects. In: European Symposium on Programming, pp. 80–94. Springer, Berlin (2009)

  48. Plotkin, G.D., Pretnar, M.: Handling algebraic effects. Logical Methods Comput. Sci. 9(4), 1–36 (2013)

  49. Pretnar, M., Saleh, A.H.S., Faes, A., Schrijvers, T.: Efficient compilation of algebraic effects and handlers. Tech. rep., Department of Computer Science, KU Leuven; Leuven, Belgium (2017)

  50. Reynolds, J.C.: Definitional interpreters for higher-order programming languages. In: Proceedings of the ACM Annual Conference, pp. 717–740. ACM, New York (1972)

  51. Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Proceedings of the IFIP World Computer Congress, pp. 513–523. Elsevier (North-Holland), Amsterdam (1983)

  52. Schuster, P., Brachthäuser, J.I.: Typing, representing, and abstracting control. In: Proceedings of the Workshop on Type-Driven Development, pp. 14–24. ACM, New York (2018). https://doi.org/10.1145/3240719.3241788

  53. Schuster, P., Brachthäuser, J.I., Ostermann, K.: Compiling effect handlers in capability-passing style. Proc. ACM Program. Lang. 4(ICFP) (2020). https://doi.org/10.1145/3408975

  54. Wadler, P.: Theorems for free! In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pp. 347–359. ACM, New York (1989)

  55. Wu, N., Schrijvers, T.: Fusion for free—efficient algebraic effect handlers. In: Proceedings of the Conference on Mathematics of Program Construction. Springer LNCS 9129 (2015)

  56. Xie, N., Brachthäuser, J.I., Hillerström, D., Schuster, P., Leijen, D.: Effect handlers, evidently. Proc. ACM Program. Lang. 4(ICFP) (2020). https://doi.org/10.1145/3408981

  57. Xie, N., Leijen, D.: Generalized evidence passing for effect handlers. Tech. Rep. MSR-TR-2021-5, Microsoft (2021). https://www.microsoft.com/en-us/research/publication/generalized-evidence-passing-for-effect-handlers/. V2, 2021-04-24

  58. Zhang, Y., Myers, A.C.: Abstraction-safe effect handlers via tunneling. Proc. ACM Program. Lang. 3(POPL), 5:1–5:29 (2019)

  59. 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–295. ACM, New York (2016)

  60. Zhang, Y., Salvaneschi, G., Myers, A.C.: Handling bidirectional control flow. Proc. ACM Program. Lang. 4(OOPSLA) (2020). https://doi.org/10.1145/3428207

Download references