Skip to main content
Top

2018 | OriginalPaper | Chapter

Concurrent System Programming with Effect Handlers

Authors : Stephen Dolan, Spiros Eliopoulos, Daniel Hillerström, Anil Madhavapeddy, K. C. Sivaramakrishnan, Leo White

Published in: Trends in Functional Programming

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Algebraic effects and their handlers have been steadily gaining attention as a programming language feature for composably expressing user-defined computational effects. While several prototype implementations of languages incorporating algebraic effects exist, Multicore OCaml incorporates effect handlers as the primary means of expressing concurrency in the language. In this paper, we make the observation that effect handlers can elegantly express particularly difficult programs that combine system programming and concurrency without compromising performance. Our experimental results on a highly concurrent and scalable web server demonstrate that effect handlers perform on par with highly optimised monadic concurrency libraries, while retaining the simplicity of direct-style code.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
1
A comprehensive list of example programs written using effect handlers in Multicore OCaml is available at https://​github.​com/​kayceesrk/​effects-examples.
 
Literature
1.
go back to reference Abelson, H., Dybvig, R.K., Haynes, C.T., Rozas, G.J., Adams, N., Friedman, D.P., Kohlbecker, E., Steele, G., Bartley, D.H., Halstead, R., et al.: Revised(5) report on the algorithmic language Scheme. High. Order Symbolic Comput. 11(1), 7–105 (1998)CrossRef Abelson, H., Dybvig, R.K., Haynes, C.T., Rozas, G.J., Adams, N., Friedman, D.P., Kohlbecker, E., Steele, G., Bartley, D.H., Halstead, R., et al.: Revised(5) report on the algorithmic language Scheme. High. Order Symbolic Comput. 11(1), 7–105 (1998)CrossRef
4.
go back to reference Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Logical Algebraic Methods Program. 84(1), 108–123 (2015)MathSciNetCrossRef Bauer, A., Pretnar, M.: Programming with algebraic effects and handlers. J. Logical Algebraic Methods Program. 84(1), 108–123 (2015)MathSciNetCrossRef
6.
go back to reference Bruggeman, C., Waddell, O., Dybvig, R.K.: Representing control in the presence of one-shot continuations. In: Fischer, C.N. (ed.) Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI), 21–24 May 1996, pp. 99–107. ACM, Philadephia (1996) Bruggeman, C., Waddell, O., Dybvig, R.K.: Representing control in the presence of one-shot continuations. In: Fischer, C.N. (ed.) Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation (PLDI), 21–24 May 1996, pp. 99–107. ACM, Philadephia (1996)
8.
go back to reference Dolan, S., White, L., Madhavapeddy, A.: Multicore OCaml. In: OCaml Workshop (2014) Dolan, S., White, L., Madhavapeddy, A.: Multicore OCaml. In: OCaml Workshop (2014)
9.
go back to reference Dolan, S., White, L., Sivaramakrishnan, K.C., Yallop, J., Madhavapeddy, A.: Effective concurrency through Algebraic Effects. In: OCaml Workshop (2015) Dolan, S., White, L., Sivaramakrishnan, K.C., Yallop, J., Madhavapeddy, A.: Effective concurrency through Algebraic Effects. In: OCaml Workshop (2015)
10.
go back to reference Forster, Y., Kammar, O., Lindley, S., Pretnar, M.: On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control. Proceedings of ACM on Programming Languages, vol. 1(ICFP), pp. 13:1–13:29, August 2017. https://doi.org/10.1145/3110257CrossRef Forster, Y., Kammar, O., Lindley, S., Pretnar, M.: On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control. Proceedings of ACM on Programming Languages, vol. 1(ICFP), pp. 13:1–13:29, August 2017. https://​doi.​org/​10.​1145/​3110257CrossRef
13.
go back to reference Hillerström, D., Lindley, S., Atkey, R., Sivaramakrishnan, K.C.: Continuation passing style for effect handlers. In: Miller, D. (ed.) 2nd International Conference on Formal Structures for Computation and Deduction (FSCD 2017). In: Leibniz International Proceedings in Informatics (LIPIcs), vol. 84, pp. 18:1–18:19. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl (2017). http://drops.dagstuhl.de/opus/volltexte/2017/7739 Hillerström, D., Lindley, S., Atkey, R., Sivaramakrishnan, K.C.: Continuation passing style for effect handlers. In: Miller, D. (ed.) 2nd International Conference on Formal Structures for Computation and Deduction (FSCD 2017). In: Leibniz International Proceedings in Informatics (LIPIcs), vol. 84, pp. 18:1–18:19. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl (2017). http://​drops.​dagstuhl.​de/​opus/​volltexte/​2017/​7739
14.
go back to reference Hillerström, D., Lindley, S., Sivaramakrishnan, K.C.: Compiling links effect handlers to the OCaml backend. In: ML Workshop (2016) Hillerström, D., Lindley, S., Sivaramakrishnan, K.C.: Compiling links effect handlers to the OCaml backend. In: ML Workshop (2016)
18.
go back to reference Kiselyov, O., Sivaramakrishnan, K.C.: Eff directly in OCaml. In: ML Workshop (2016) Kiselyov, O., Sivaramakrishnan, K.C.: Eff directly in OCaml. In: ML Workshop (2016)
22.
go back to reference Marlow, S., Jones, S.P., Moran, A., Reppy, J.: Asynchronous exceptions in Haskell. In: Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, PLDI 2001, pp. 274–285. ACM, New York (2001). https://doi.org/10.1145/378795.378858 Marlow, S., Jones, S.P., Moran, A., Reppy, J.: Asynchronous exceptions in Haskell. In: Proceedings of the ACM SIGPLAN 2001 Conference on Programming Language Design and Implementation, PLDI 2001, pp. 274–285. ACM, New York (2001). https://​doi.​org/​10.​1145/​378795.​378858
29.
go back to reference Pretnar, M., Saleh, A.H., Faes, A., Schrijvers, T.: Efficient compilation of algebraic effects and handlers. Technical report CW 708, KU Leuven, Belgium, October 2017 Pretnar, M., Saleh, A.H., Faes, A., Schrijvers, T.: Efficient compilation of algebraic effects and handlers. Technical report CW 708, KU Leuven, Belgium, October 2017
30.
go back to reference Saleh, A.H., Schrijvers, T.: Efficient algebraic effect handlers for prolog. Theory Pract. Logic Program. 16(5–6), 884–898 (2016)MathSciNetCrossRef Saleh, A.H., Schrijvers, T.: Efficient algebraic effect handlers for prolog. Theory Pract. Logic Program. 16(5–6), 884–898 (2016)MathSciNetCrossRef
31.
go back to reference Sivaramakrishnan, K.C., Harris, T., Marlow, S., Peyton Jones, S.: Composable scheduler activations for haskell. J. Funct. Program. 26, e9 (2016)MathSciNetCrossRef Sivaramakrishnan, K.C., Harris, T., Marlow, S., Peyton Jones, S.: Composable scheduler activations for haskell. J. Funct. Program. 26, e9 (2016)MathSciNetCrossRef
33.
go back to reference Virding, R., Wikström, C., Williams, M.: Concurrent Programming in ERLANG, 2nd edn. Prentice Hall International (UK) Ltd., Hertfordshire (1996)MATH Virding, R., Wikström, C., Williams, M.: Concurrent Programming in ERLANG, 2nd edn. Prentice Hall International (UK) Ltd., Hertfordshire (1996)MATH
Metadata
Title
Concurrent System Programming with Effect Handlers
Authors
Stephen Dolan
Spiros Eliopoulos
Daniel Hillerström
Anil Madhavapeddy
K. C. Sivaramakrishnan
Leo White
Copyright Year
2018
DOI
https://doi.org/10.1007/978-3-319-89719-6_6

Premium Partner