Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
169 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
45 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Tackling the Awkward Squad for Reactive Programming: The Actor-Reactor Model (2306.12313v1)

Published 21 Jun 2023 in cs.PL

Abstract: Reactive programming is a programming paradigm whereby programs are internally represented by a dependency graph, which is used to automatically (re)compute parts of a program whenever its input changes. In practice reactive programming can only be used for some parts of an application: a reactive program is usually embedded in an application that is still written in ordinary imperative languages such as JavaScript or Scala. In this paper we investigate this embedding and we distill "the awkward squad for reactive programming" as 3 concerns that are essential for real-world software development, but that do not fit within reactive programming. They are related to long lasting computations, side-effects, and the coordination between imperative and reactive code. To solve these issues we design a new programming model called the Actor-Reactor Model in which programs are split up in a number of actors and reactors. Actors and reactors enforce a strict separation of imperative and reactive code, and they can be composed via a number of composition operators that make use of data streams. We demonstrate the model via our own implementation in a language called Stella.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (58)
  1. Structure and Interpretation of Computer Programs, Second Edition. MIT Press, 1996.
  2. Jasmin: High-assurance and high-speed cryptography. In Bhavani M. Thuraisingham, David Evans, Tal Malkin, and Dongyan Xu, editors, Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, CCS 2017, Dallas, TX, USA, October 30 - November 03, 2017, pages 1807–1823. ACM, 2017. doi:10.1145/3133956.3134078.
  3. A survey on reactive programming. ACM Computing Surveys, 45(4):52:1–52:34, 2013. doi:10.1145/2501654.2501666.
  4. Gérard Berry. Real time programming: Special purpose or general purpose languages. In Gerhard Ritter, editor, Information Processing 89, Proceedings of the IFIP 11th World Computer Congress, San Francisco, USA, August 28 - September 1, 1989., pages 11–17. North-Holland/IFIP, 1989.
  5. The esterel synchronous programming language: Design, semantics, implementation. Science of Computer Programming, 19(2):87–152, 1992. doi:10.1016/0167-6423(92)90005-V.
  6. Hop and hiphop: Multitier web orchestration. In Raja Natarajan, editor, Distributed Computing and Internet Technology - 10th International Conference, ICDCIT 2014, Bhubaneswar, India, February 6-9, 2014. Proceedings, volume 8337 of Lecture Notes in Computer Science, pages 1–13. Springer, 2014. doi:10.1007/978-3-319-04483-5_1.
  7. The reactive manifesto. https://web.archive.org/web/20191210084324/https://www.reactivemanifesto.org/. Accessed: 2019-12-10.
  8. Theory of computation. John Wiley & Sons, Inc., 1974. URL: https://archive.org/details/theoryofcomputat00brai.
  9. Loosely-coupled distributed reactive programming in mobile ad hoc networks. In Jan Vitek, editor, Objects, Models, Components, Patterns, 48th International Conference, TOOLS 2010, Málaga, Spain, June 28 - July 2, 2010. Proceedings, volume 6141 of Lecture Notes in Computer Science, pages 41–60. Springer, 2010. doi:10.1007/978-3-642-13953-6_3.
  10. Fact: A flexible, constant-time programming language. In IEEE Cybersecurity Development, SecDev 2017, Cambridge, MA, USA, September 24-26, 2017, pages 69–76. IEEE Computer Society, 2017. doi:10.1109/SecDev.2017.24.
  11. Termination proofs for systems code. In Michael I. Schwartzbach and Thomas Ball, editors, Proceedings of the ACM SIGPLAN 2006 Conference on Programming Language Design and Implementation, Ottawa, Ontario, Canada, June 11-14, 2006, pages 415–426. ACM, 2006. doi:10.1145/1133981.1134029.
  12. Embedding dynamic dataflow in a call-by-value language. In Peter Sestoft, editor, Programming Languages and Systems, 15th European Symposium on Programming, ESOP 2006, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2006, Vienna, Austria, March 27-28, 2006, Proceedings, volume 3924 of Lecture Notes in Computer Science, pages 294–308. Springer, 2006. doi:10.1007/11693024_20.
  13. Oracle Corporation. JEP 266: More concurrency updates. https://web.archive.org/web/20191009093608/https://openjdk.java.net/jeps/266. Accessed: 2019-10-09.
  14. Evan Czaplicki. A farewell to frp. https://web.archive.org/web/20191208051242/https://elm-lang.org/news/farewell-to-frp. Accessed: 2019-12-30.
  15. Asynchronous functional reactive programming for GUIs. In Hans-Juergen Boehm and Cormac Flanagan, editors, ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’13, Seattle, WA, USA, June 16-19, 2013, pages 411–422. ACM, 2013. doi:10.1145/2491956.2462161.
  16. A survey of active object languages. ACM Computing Surveys, 50(5):76:1–76:39, 2017. doi:10.1145/3122848.
  17. The synchronous hypothesis and synchronous languages. In Richard Zurawski, editor, Embedded Systems Handbook. CRC Press, 2005. doi:10.1201/9781420038163.ch8.
  18. Tackling the awkward squad for reactive programming: The actor reactor model (artifact). Dagstuhl Artifacts Series (DARTS), 6(2), 2020. Accepted/In press.
  19. Thread-safe reactive programming. Proceedings of the ACM on Programming Languages, 2(OOPSLA):107:1–107:30, 2018. doi:10.1145/3276477.
  20. Jonathan Edwards. Coherent reaction. In Shail Arora and Gary T. Leavens, editors, Companion to the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2009, October 25-29, 2009, Orlando, Florida, USA, pages 925–932. ACM, 2009. doi:10.1145/1639950.1640058.
  21. Jonathan Edwards. Coherent reaction. Technical Report MIT-CSAIL-TR-2009-024, Massachusetts Institute of Technology, Computer Science and Artificial Intelligence Laboratory, Cambridge, 02139 Massachusetts, USA, June 2009. URL: http://web.archive.org/web/20181103183154/http://dspace.mit.edu/bitstream/handle/1721.1/45563/MIT-CSAIL-TR-2009-024.pdf?sequence=1.
  22. Bonnie Eisenman. Learning React Native: Building Native Mobile Apps with JavaScript. O’Reilly Media, Inc., 2 edition, 2017.
  23. Essentials of programming languages (3. ed.). MIT Press, 2008.
  24. SIGNAL: A declarative language for synchronous programming of real-time systems. In Gilles Kahn, editor, Functional Programming Languages and Computer Architecture, Portland, Oregon, USA, September 14-16, 1987, Proceedings, volume 274 of Lecture Notes in Computer Science, pages 257–277. Springer, 1987. doi:10.1007/3-540-18317-5_15.
  25. Smalltalk-80: The Language and Its Implementation. Addison-Wesley, 1983.
  26. Programming and verifying real-time systems by means of the synchronous data-flow language LUSTRE. IEEE Transactions on Software Engineering, 18(9):785–793, 1992. doi:10.1109/32.159839.
  27. Crossing state lines: Adapting object-oriented frameworks to functional reactive languages. In Masami Hagiya and Philip Wadler, editors, Functional and Logic Programming, 8th International Symposium, FLOPS 2006, Fuji-Susono, Japan, April 24-26, 2006, Proceedings, volume 3945 of Lecture Notes in Computer Science, pages 259–276. Springer, 2006. doi:10.1007/11737414_18.
  28. Facebook Inc. Components and props. https://web.archive.org/web/20191126131226/http://reactjs.org/docs/components-and-props.html. Accessed: 2019-11-26.
  29. Facebook Inc. React: A javascript library for building user interfaces. https://web.archive.org/web/20191009084855/http://reactjs.org/. Accessed: 2019-10-09.
  30. Reactive Streams Initiative. Reactive streams. https://web.archive.org/web/20191009093755/https://www.reactive-streams.org/. Accessed: 2019-10-09.
  31. 43 years of actors: a taxonomy of actor models and their key properties. In Sylvan Clebsch, Travis Desell, Philipp Haller, and Alessandro Ricci, editors, Proceedings of the 6th International Workshop on Programming Based on Actors, Agents, and Decentralized Control, AGERE 2016, Amsterdam, The Netherlands, October 30, 2016, pages 31–40. ACM, 2016. doi:10.1145/3001886.3001890.
  32. Reactive Design Patterns. Manning Publications Co., Greenwich, CT, USA, 1st edition, 2017.
  33. Miran Lipovaca. Learn You a Haskell for Great Good!: A Beginner’s Guide. No Starch Press, San Francisco, CA, USA, 1st edition, 2011.
  34. Deprecating the observer pattern with scala.react. Technical Report EPFL-REPORT-176887, École Polytechnique Fédérale de Lausanne, EPFL IC IINFCOM LAMP, Station 14, 1015 Lausanne, 2012. URL: http://web.archive.org/web/20200522141109/https://infoscience.epfl.ch/record/176887.
  35. Flapjax: a programming language for ajax applications. In Shail Arora and Gary T. Leavens, editors, Proceedings of the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2009, October 25-29, 2009, Orlando, Florida, USA, pages 1–20. ACM, 2009. doi:10.1145/1640089.1640091.
  36. Size-change termination as a contract: dynamically and statically enforcing termination for higher-order programs. In Kathryn S. McKinley and Kathleen Fisher, editors, Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2019, Phoenix, AZ, USA, June 22-26, 2019., pages 845–859. ACM, 2019. doi:10.1145/3314221.3314643.
  37. Composable higher-order reactors as the basis for a live reactive programming environment. In Guido Salvaneschi, Wolfgang De Meuter, Patrick Eugster, Lukasz Ziarek, and Francisco Sant’Anna, editors, Proceedings of the 5th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems, REBLS@SPLASH 2018, Boston, MA, USA, November 4, 2018, pages 51–60. ACM, 2018. doi:10.1145/3281278.3281284.
  38. Simon Peyton Jones. Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in haskell. Engineering Theories of Software Construction, 180:47–96, January 2001. IOS Press.
  39. ReactiveX. Do. https://web.archive.org/web/20200415125833/http://reactivex.io/documentation/operators/do.html. Accessed: 2020-04-15.
  40. ReactiveX. Introduction. https://web.archive.org/web/20200415132837/http://reactivex.io/rxjs/manual/overview.html. Accessed: 2020-04-15.
  41. ReactiveX. ReactiveX: An api for asynchronous programming with observable streams. https://web.archive.org/web/20191009085652/http://reactivex.io/. Accessed: 2019-10-09.
  42. REScala. REScala manual. https://web.archive.org/web/20191126124033/http://www.rescala-lang.com/manual/. Accessed: 2019-11-26.
  43. REUK. Betz limit. https://web.archive.org/web/20191025112828/http://www.reuk.co.uk/wordpress/wind/calculation-of-wind-power/. Accessed: 2019-10-25.
  44. REUK. Calculation of wind power. https://web.archive.org/web/20191025113431/http://www.reuk.co.uk/wordpress/wind/betz-limit/. Accessed: 2019-10-25.
  45. RexEgg. The explosive quantifier trap. https://web.archive.org/web/20191223155226/https://www.rexegg.com/regex-explosive-quantifiers.html. Accessed: 2019-12-23.
  46. Akka in action. Manning Publications Co., 1 edition, 2016.
  47. Rescala: bridging between object-oriented and functional style in reactive applications. In Walter Binder, Erik Ernst, Achille Peternier, and Robert Hirschfeld, editors, 13th International Conference on Modularity, MODULARITY ’14, Lugano, Switzerland, April 22-26, 2014, pages 25–36. ACM, 2014. doi:10.1145/2577080.2577083.
  48. On the positive effect of reactive programming on software comprehension: An empirical study. IEEE Transactions on Software Engineering, 43(12):1125–1143, 2017. doi:10.1109/TSE.2017.2655524.
  49. The design and implementation of the synchronous language CÉU. ACM Trans. Embedded Comput. Syst., 16(4):98:1–98:26, 2017. doi:10.1145/3035544.
  50. RxJS Team. RxJS: Reactive extensions library for javascript. https://web.archive.org/web/20191125123104/https://rxjs.dev/. Accessed: 2019-11-25.
  51. The Flapjax Team. Flapjax framework api documentation. https://web.archive.org/web/20191128081915/https://www.flapjax-lang.org/docs/. Accessed: 2019-11-28.
  52. D. A. Turner. Total functional programming. Journal of Universal Computer Science, 10(7):751–768, 2004. doi:10.3217/jucs-010-07-0751.
  53. GitHub user “htimur”. Akka Streams: Utility function for side effects #23512. https://web.archive.org/web/20200415164156/https://github.com/akka/akka/issues/23512. Accessed: 2020-04-15.
  54. GitHub user “otto-dev”. Request: Overloaded version of .alsoTo that takes a function #28524. https://web.archive.org/web/20200415154306/https://github.com/akka/akka/issues/28524. Accessed: 2020-04-15.
  55. Stream processing with a spreadsheet. In Richard E. Jones, editor, ECOOP 2014 - Object-Oriented Programming - 28th European Conference, Uppsala, Sweden, July 28 - August 1, 2014. Proceedings, volume 8586 of Lecture Notes in Computer Science, pages 360–384. Springer, 2014. doi:10.1007/978-3-662-44202-9_15.
  56. Hiphop.js: a language to orchestrate web applications. In Hisham M. Haddad, Roger L. Wainwright, and Richard Chbeir, editors, Proceedings of the 33rd Annual ACM Symposium on Applied Computing, SAC 2018, Pau, France, April 09-13, 2018, pages 2193–2195. ACM, 2018. doi:10.1145/3167132.3167440.
  57. Real-time FRP. In Benjamin C. Pierce, editor, Proceedings of the Sixth ACM SIGPLAN International Conference on Functional Programming (ICFP ’01), Firenze (Florence), Italy, September 3-5, 2001, pages 146–156. ACM, 2001. doi:10.1145/507635.507654.
  58. Object-oriented concurrent programming in ABCL/1. In Norman K. Meyrowitz, editor, Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’86), Portland, Oregon, USA, Proceedings., pages 258–268. ACM, 1986. doi:10.1145/28697.28722.

Summary

We haven't generated a summary for this paper yet.