Skip to main content

Joinads: A Retargetable Control-Flow Construct for Reactive, Parallel and Concurrent Programming

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2011)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 6539))

Included in the following conference series:

  • 713 Accesses

Abstract

Modern challenges led to a design of a wide range of programming models for reactive, parallel and concurrent programming, but these are often difficult to encode in general purpose languages. We present an abstract type of computations called joinads together with a syntactic language extension that aims to make it easier to use joinads in modern functional languages.

Our extension generalizes pattern matching to work on abstract computations. It keeps a familiar syntax and semantics of pattern matching making it easy to reason about code, even in a non-standard programming model. We demonstrate our extension using three important programming models – a reactive model based on events; a concurrent model based on join calculus and a parallel model using futures. All three models are implemented as libraries that benefit from our syntactic extension. This makes them easier to use and also opens space for exploring new useful programming models.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Syme, D., Granicz, A., Cisternino, A.: Expert F#, ch. 9. Apress (2007)

    Google Scholar 

  2. Wadler, P.: Monads for functional programming. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  3. Syme, D.: F# Language Specification, http://tinyurl.com/fsspec

  4. Petricek, T.: Reactive Programming with Events (Master thesis), Charles University (2010)

    Google Scholar 

  5. Fournet, C., Gonthier, G.: The reflexive CHAM and the join-calculus. In: POPL 1996 (1996)

    Google Scholar 

  6. Fournet, C., Le Fessant, F., Maranget, L., Schmitt, A.: JoCaml: A language for concurrent distributed and mobile programming. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 129–158. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  7. Benton, N., Cardelli, L., Fournet, C.: Modern concurrency abstractions for C#. ACM Trans. Program. Lang. Syst 26(5), 769–804 (2004)

    Article  MATH  Google Scholar 

  8. Russo, C.: The Joins concurrency library. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 260–274. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  9. Yorgey, B.: The Typeclassopedia. The Monad.Reader Issue 13, http://tinyurl.com/tycls

  10. Haller, P., Van Cutsem, T.: Implementing Joins Using Extensible Pattern Matching. In: Wang, A.H., Tennenholtz, M. (eds.) COORDINATION 2008. LNCS, vol. 5052, pp. 135–152. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  11. Tullsen, M.: First class patterns. In: Pontelli, E., Santos Costa, V. (eds.) PADL 2000. LNCS, vol. 1753, p. 1. Springer, Heidelberg (2000)

    Google Scholar 

  12. Fluet, M., Rainey, M., Reppy, J., Shaw, A.: Implicitly-threaded parallelism in Manticore. In: Proceedings of ICFP 2008 (2008)

    Google Scholar 

  13. Syme, D., Neverov, G., Margetson, J.: Extensible Pattern Matching via a Lightweight Language Extension. In: ICFP (2007)

    Google Scholar 

  14. Wadler, P: Views: A way for pattern matching to cohabit with data abstraction. In: POPL 1987 (1987)

    Google Scholar 

  15. Peyton Jones, S.: Wearing the hair shirt - A retrospective on Haskell. Invited talk POPL (2003), Slides available online at http://tinyurl.com/haskellretro

  16. McBride, C., Paterson, R.: Applicative programming with effects. Journal of Func. Programming 18 (2008)

    Google Scholar 

  17. Scholz, E.: Imperative streams - a monadic combinator library for synchronous programming. In: Proc. ICFP (1998)

    Google Scholar 

  18. Peyton Jones, S. (ed.): Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press, Cambridge (2003)

    MATH  Google Scholar 

  19. Emir, B., Odersky, M., Williams, J.: Matching Objects with Patterns. In: Bateni, M. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 273–298. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  20. King, D., Wadler, P.: Combining Monads. In: Proceedings of Glasgow Workshop on Functional Programming (1992)

    Google Scholar 

  21. Okasaki, C.: Views for Standard ML. In: Proc. of Workshop on ML, pp. 14–23 (1998)

    Google Scholar 

  22. Hughes, J.: Generalising Monads to Arrows. Sci. of Comput. Prog. 37, 67–111 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  23. Elliott, C.: Declarative event-oriented programming. In: Proceedings of PPDP 2000 (2000)

    Google Scholar 

  24. Liu, H., Cheng, E., Hudak, P.: Causal commutative arrows and their optimization. In: ICFP 2009 (2009)

    Google Scholar 

  25. Bierman, G.M., Meijer, E., Torgersen, M.: Lost In Translation: Formalizing Proposed Extensions to C#. In: Proc. of OOPSLA 2007 (2007)

    Google Scholar 

  26. Lindley, S., Wadler, P., Yallop, J.: The arrow calculus, Technical Report EDI-INF-RR-1258, School of Informatics, University of Edinburgh (2008)

    Google Scholar 

  27. Petricek, T., Syme, D.: Joinads (Extended version), http://tinyurl.com/joinads

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Petricek, T., Syme, D. (2011). Joinads: A Retargetable Control-Flow Construct for Reactive, Parallel and Concurrent Programming. In: Rocha, R., Launchbury, J. (eds) Practical Aspects of Declarative Languages. PADL 2011. Lecture Notes in Computer Science, vol 6539. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18378-2_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-18378-2_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-18377-5

  • Online ISBN: 978-3-642-18378-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics