Skip to main content

Reactivity of Cooperative Systems

Application to ReactiveML

  • Conference paper
Static Analysis (SAS 2014)

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

Included in the following conference series:

Abstract

Cooperative scheduling enables efficient sequential implementations of concurrency. It is widely used to provide lightweight threads facilities as libraries or programming constructs in many programming languages. However, it is up to programmers to actually cooperate to ensure the reactivity of their programs.

We present a static analysis that checks the reactivity of programs by abstracting them into so-called behaviors using a type-and-effect system. Our objective is to find a good compromise between the complexity of the analysis and its precision for typical reactive programs. The simplicity of the analysis is mandatory for the programmer to be able to understand error messages and how to fix reactivity problems.

Ourwork is applied and implemented in the functional synchronous language ReactiveML. It handles recursion, higher-order processes and firstclass signals. We prove the soundness of our analysis with respect to the big-step semantics of the language: a well-typed program with reactive effects is reactive. The analysis is easy to implement and generic enough to be applicable to other models of concurrency such as coroutines.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abel, A., Pientka, B.: Well-founded recursion with copatterns. In: International Conference on Functional Programming (2013)

    Google Scholar 

  2. Amadio, R., Dabrowski, F.: Feasible reactivity in a synchronous π-calculus. In: Principles and Practice of Declarative Programming, pp. 221–230 (2007)

    Google Scholar 

  3. Amtoft, T., Nielson, F., Nielson, H.: Type and Effect Systems: Behaviours for Concurrency. Imperial College Press (1999)

    Google Scholar 

  4. Atkey, R., McBride, C.: Productive coprogramming with guarded recursion. In: International Conference on Functional Programming (2013)

    Google Scholar 

  5. Barthe, G., Frade, M.J., Giménez, E., Pinto, L., Uustalu, T.: Type-based termination of recursive definitions. Mathematical Structures in Computer Science 14(01), 97–141 (2004)

    Article  MATH  Google Scholar 

  6. Benveniste, A., Caspi, P., Edwards, S.A., Halbwachs, N., Guernic, P.L., De Simone, R.: The synchronous languages twelve years later. In: Proc. of the IEEE (2003)

    Google Scholar 

  7. Boudol, G.: ULM: A core programming model for global computing. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 234–248. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  8. Boudol, G.: Typing termination in a higher-order concurrent imperative language. Information and Computation 208(6), 716–736 (2010)

    Article  MATH  MathSciNet  Google Scholar 

  9. Boussinot, F.: Reactive C: an extension of C to program reactive systems. Software: Practice and Experience 21(4), 401–428 (1991)

    Google Scholar 

  10. Cuoq, P., Pouzet, M.: Modular Causality in a Synchronous Stream Language. In: Sands, D. (ed.) ESOP 2001. LNCS, vol. 2028, pp. 237–251. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  11. Dimino, J.: Lwt User Manual (2014), http://ocsigen.org/lwt/

  12. Engelschall, R.: Portable multithreading: The signal stack trick for user-space thread creation. In: USENIX Annual Technical Conference (2000)

    Google Scholar 

  13. Huet, G.: A unification algorithm for typed λ-calculus. Theoretical Computer Science 1(1), 27–57 (1975)

    Article  MathSciNet  Google Scholar 

  14. Jeffrey, A.: Functional reactive programming with liveness guarantees. In: International Conference on Functional Programming (2013)

    Google Scholar 

  15. Jones, S., Gordon, A., Finne, S.: Concurrent Haskell. In: Principles of Programming Languages, pp. 295–308 (1996)

    Google Scholar 

  16. Lee, O., Yi, K.: Proofs about a folklore let-polymorphic type inference algorithm. Transactions on Programming Languages and Systems 20(4), 707–723 (1998)

    Article  Google Scholar 

  17. Leroy, X., Pessaux, F.: Type-based analysis of uncaught exceptions. Transactions on Programming Languages and Systems 22(2), 340–377 (2000)

    Article  Google Scholar 

  18. Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: Principles of Programming Languages (1988)

    Google Scholar 

  19. Mandel, L., Pouzet, M.: ReactiveML: A reactive extension to ML. In: Principles and Practice of Declarative Programming (2005)

    Google Scholar 

  20. Mandel, L., Pasteur, C.: Reactivity of cooperative systems – extended version. Research Report 8549, INRIA (2014), http://reactiveml.org/sas14

  21. Mandel, L., Pasteur, C., Pouzet, M.: Time refinement in a functional synchronous language. In: Principles and Practice of Declarative Programming. (2013)

    Google Scholar 

  22. Marlow, S., Jones, S., Thaller, W.: Extending the Haskell foreign function interface with concurrency. In: Haskell 2004, pp. 22–32. ACM (2004)

    Google Scholar 

  23. Nielson, F., Nielson, H.: Type and effect systems. Correct System Design (1999)

    Google Scholar 

  24. Pierce, B.: Types and programming languages. The MIT Press (2002)

    Google Scholar 

  25. Potop-Butucaru, D., Edwards, S.A., Berry, G.: Compiling Esterel. Springer (2007)

    Google Scholar 

  26. Rémy, D.: Type inference for records in a natural extension of ML. Theoretical Aspects of Object-Oriented Programming. MIT Press (1993)

    Google Scholar 

  27. Rémy, D.: Using, understanding, and unraveling the OCaml language from practice to theory and vice versa. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) Applied Semantics. LNCS, vol. 2395, pp. 413–536. Springer, Heidelberg (2002)

    Google Scholar 

  28. Reppy, J.: Concurrent programming in ML. Cambridge University Press (2007)

    Google Scholar 

  29. Sijtsma, B.A.: On the productivity of recursive list definitions. Transactions on Programming Languages and Systems 11(4), 633–649 (1989)

    Article  Google Scholar 

  30. Syme, D., Petricek, T., Lomov, D.: The F# asynchronous programming model. Practical Aspects of Declarative Languages, 175–189 (2011)

    Google Scholar 

  31. Talpin, J.P., Jouvelot, P.: The type and effect discipline. In: Logic in Computer Science (1992)

    Google Scholar 

  32. Tardieu, O., de Simone, R.: Loops in Esterel. Transaction on Embedded Computing 4(4), 708–750 (2005)

    Article  Google Scholar 

  33. Tofte, M.: Type inference for polymorphic references. Information and computation 89(1), 1–34 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  34. Vouillon, J.: Lwt: A cooperative thread library. In: ACM workshop on ML (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Mandel, L., Pasteur, C. (2014). Reactivity of Cooperative Systems. In: Müller-Olm, M., Seidl, H. (eds) Static Analysis. SAS 2014. Lecture Notes in Computer Science, vol 8723. Springer, Cham. https://doi.org/10.1007/978-3-319-10936-7_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-10936-7_14

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-10935-0

  • Online ISBN: 978-3-319-10936-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics