Skip to main content

Functional Reactive Programming in C++

  • Chapter
  • First Online:
  • 361 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10094))

Abstract

Reactive programming is a relatively new discipline that teaches how to design and develop complex systems through the notion of data-flow. The main idea is that the system, and its components, are able to receive signals, and to react to them in some way. The signals can be seen as streams of messages that we can transform using the usual monadic functions (map, bind, filter, etc.) and that we can easily direct through our system.

Reactive programming removes the usual complexity of explicitly dealing with the shared mutable state, manual synchronization with mutexes, and alike.

We are presenting an approach for implementing reactive systems in the C++ programming language, by creating abstractions over the commonly used methods for achieving concurrency, like callbacks and signals and slots.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   74.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

References

  1. Armstrong, J.: Making reliable distributed systems in the presence of software errors (2003)

    Google Scholar 

  2. Bainomugisha, E., Carreton, A.L., van Cutsem, T., Mostinckx, S., de Meuter, W.: A survey on reactive programming. ACM Comput. Surv. 45(4), 52:1–52:34 (2013)

    Article  Google Scholar 

  3. Butenhof, D.: Recursive mutexes (2005)

    Google Scholar 

  4. Carmack, J.: In-depth: functional programming in C++ (2012)

    Google Scholar 

  5. Charousset, D., Hiesgen, R., Schmidt, T.C.: CAF-the C++ actor framework for scalable and resource-efficient applications. In: Proceedings of the 4th International Workshop on Programming based on Actors Agents and Decentralized Control, pp. 15–28. ACM (2014)

    Google Scholar 

  6. Claessen, K.: Functional pearls: a poor man’s concurrency monad (1999)

    Google Scholar 

  7. Epstein, J., Black, A.P., Peyton-Jones, S.: Towards Haskell in the cloud. SIGPLAN Not. 46(12), 118–129 (2011)

    Article  Google Scholar 

  8. Hewitt, C., Bishop, P., Steiger, R.: A universal modular actor formalism for artificial intelligence. In: Proceedings of the 3rd International Joint Conference on Artificial Intelligence, IJCAI 1973, pp. 235–245. Morgan Kaufmann Publishers Inc., San Francisco (1973)

    Google Scholar 

  9. Järvi, J.: C++ function object binders made easy. In: Czarnecki, K., Eisenecker, U.W. (eds.) GCSE 1999. LNCS, vol. 1799, pp. 165–177. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-40048-6_13

    Chapter  Google Scholar 

  10. Kohlhoff, C.: Boost.asio, 48(0), 2003–2013 (2003). http://www.boost.org/doc/libs/

  11. Lee, E.A.: The problem with threads. Computer 39(5), 33–42 (2006)

    Article  Google Scholar 

  12. Maier, I., Rompf, T., Odersky, M.: Deprecating the observer pattern. Technical report (2010)

    Google Scholar 

  13. Rodgers, D.P.: Improvements in multiprocessor system design. SIGARCH Comput. Archit. News 13(3), 225–231 (1985)

    Article  Google Scholar 

  14. Steele, G.L., Sussman, G.J.: Lambda: the ultimate imperative. Technical report (1976)

    Google Scholar 

  15. Wan, Z., Hudak, P.: Functional reactive programming from first principles. In: ACM SIGPLAN Notices, vol. 35, pp. 242–252. ACM (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ivan Čukić .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Čukić, I. (2019). Functional Reactive Programming in C++. In: Zsók, V., Porkoláb, Z., Horváth, Z. (eds) Central European Functional Programming School. CEFP 2015. Lecture Notes in Computer Science(), vol 10094. Springer, Cham. https://doi.org/10.1007/978-3-030-28346-9_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-28346-9_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-28345-2

  • Online ISBN: 978-3-030-28346-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics