skip to main content
research-article

The chemical approach to typestate-oriented programming

Published:23 October 2015Publication History
Skip Abstract Section

Abstract

We study a novel approach to typestate-oriented programming based on the chemical metaphor: state and operations on objects are molecules of messages and state transformations are chemical reactions. This approach allows us to investigate typestate in an inherently concurrent setting, whereby objects can be accessed and modified concurrently by several processes, each potentially changing only part of their state. We introduce a simple behavioral type theory to express in a uniform way both the private and the public interfaces of objects, to describe and enforce structured object protocols consisting of possibilities, prohibitions, and obligations, and to control object sharing.

References

  1. J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestateoriented programming. In Proceedings of OOPSLA’09, pages 1015–1022. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. N. E. Beckman, D. Kim, and J. Aldrich. An empirical study of object protocols in the wild. In Proceedings of ECOOP’11, LNCS 6813, pages 2–26. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. Benton, L. Cardelli, and C. Fournet. Modern concurrency abstractions for C#. ACM Trans. Program. Lang. Syst., 26(5):769–804, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. G. Berry and G. Boudol. The chemical abstract machine. Theor. Comput. Sci., 96(1):217–248, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. Bierhoff and J. Aldrich. Modular typestate checking of aliased objects. In Proceedings of OOPSLA’07, pages 301– 320. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. A. Brzozowski. Derivatives of regular expressions. J. ACM, 11(4):481–494, 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. P. Calvert and A. Mycroft. Control flow analysis for the join calculus. In Proceedings of SAS’12, LNCS 7460, pages 181– 197. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. Conway. Regular Algebra and Finite Machines. William Clowes & Sons Ltd, 1971.Google ScholarGoogle Scholar
  9. B. Courcelle. Fundamental properties of infinite trees. Theor. Comp. Sci., 25:95–169, 1983.Google ScholarGoogle ScholarCross RefCross Ref
  10. S. Crafa and L. Padovani. The chemical approach to typestateoriented programming. Technical report, 2015. https:// hal.archives-ouvertes.fr/hal-01155682. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. Damiani, E. Giachino, P. Giannini, and S. Drossopoulou. A type safe state abstraction for coordination in Java-like languages. Acta Inf., 45(7-8):479–536, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. O. Dardha, E. Giachino, and D. Sangiorgi. Session types revisited. In Proc. of PPDP’12, pages 139–150. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. G. de Caso, V. A. Braberman, D. Garbervetsky, and S. Uchitel. Enabledness-based program abstractions for behavior validation. ACM Trans. Softw. Eng. Methodol., 22(3):25, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. DeLine and M. Fähndrich. Typestates for objects. In Proceedings of ECOOP’04, LNCS 3086, pages 465–490. Springer, 2004.Google ScholarGoogle Scholar
  15. M. Fähndrich and R. DeLine. Adoption and focus: Practical linear types for imperative programming. In Proceedings of PLDI’02, pages 13–24. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Fournet and G. Gonthier. The reflexive CHAM and the join-calculus. In Proceedings of POPL’96, pages 372–385. ACM, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Fournet and G. Gonthier. The join calculus: A language for distributed mobile programming. In Summ. Sch. Appl. Sem., LNCS 2395, pages 268–332. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Fournet, C. Laneve, L. Maranget, and D. Rémy. Implicit typing à la ML for the join-calculus. In Proceedings of CONCUR’97, LNCS 1243, pages 196–212. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Fournet, C. Laneve, L. Maranget, and D. Rémy. Inheritance in the join calculus. J. Logic Alg. Progr., 57(12):23 – 69, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  20. C. Fournet, F. Le Fessant, L. Maranget, and A. Schmitt. Jocaml: A language for concurrent distributed and mobile programming. In Advanced Functional Programming, LNCS 2638, pages 129–158. Springer, 2003.Google ScholarGoogle Scholar
  21. R. Garcia, É. Tanter, R. Wolff, and J. Aldrich. Foundations of typestate-oriented programming. ACM Trans. Program. Lang. Syst., 36(4):12, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. J. Gay and V. T. Vasconcelos. Linear type theory for asynchronous session types. J.Fun. Progr., 20(1):19–50, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S. J. Gay, V. T. Vasconcelos, A. Ravara, N. Gesbert, and A. Z. Caldeira. Modular session types for distributed objectoriented programming. In Proceedings of POPL’10, pages 299–312. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. P. Haller and T. V. Cutsem. Implementing joins using extensible pattern matching. In Proceedings of COORDINATION’08, LNCS 5052, pages 135–152. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. A. Henzinger, R. Jhala, and R. Majumdar. Permissive interfaces. In Proc. of FSE’05, pages 31–40. ACM, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. Hewitt, P. Bishop, and R. Steiger. A universal modular actor formalism for artificial intelligence. In Proceedings of IJCAI’73, pages 235–245, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. Honda. Types for dyadic interaction. In Proceedings of CONCUR’93, LNCS 715, pages 509–523. Springer, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. G. S. V. Itzstein and M. Jasiunas. On implementing high level concurrency in Java. In Proceedings of ACSAC’03, LNCS 2823, pages 151–165. Springer, 2003.Google ScholarGoogle Scholar
  29. D. Jin, P. O. Meredith, D. Griffith, and G. Ros¸u. Garbage collection for monitoring parametric properties. In Proceedings of PLDI’11, pages 415–424. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. N. Kobayashi, B. C. Pierce, and D. N. Turner. Linearity and the pi-calculus. ACM Trans. Program. Lang. Syst., 21(5):914– 947, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. F. Le Fessant and L. Maranget. Compiling join-patterns. Electr. Notes Theor. Comput. Sci., 16(3):205–224, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  32. P. O. Meredith, D. Jin, F. Chen, and G. Ros¸u. Efficient monitoring of parametric context-free patterns. Autom. Softw. Eng., 17(2):149–180, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Microsoft Research. Cω, 2004. http://research. microsoft.com/Comega/.Google ScholarGoogle Scholar
  34. E. Najm, A. Nimour, and J. Stefani. Guaranteeing liveness in an object calculus through behavioural typing. In Proceedings of FORTE’99, volume 156, pages 203–221. Kluwer, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. P. Nienaltowski. Practical Framework for Contract-Based Concurrent Object-Oriented Programming. PhD thesis, ETH Zurich, 2007.Google ScholarGoogle Scholar
  36. O. Nierstrasz. Regular types for active objects. In Proceedings of OOPSLA’93, pages 1–15. ACM, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. M. Patrignani, D. Clarke, and D. Sangiorgi. Ownership types for the join calculus. In Proceedings of FMOODS/FORTE’11, LNCS 6722, pages 289–303. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. F. Puntigam. State inference for dynamically changing interfaces. Comput. Lang., 27(4):163–202, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. F. Puntigam. Strong types for coordinating active objects. Concurrency and Computation: Practice and Experience, 13(4):293–326, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  40. F. Puntigam and C. Peter. Types for active objects with static deadlock prevention. Fundam. Inform., 48(4):315–341, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. A. Ravara and V. T. Vasconcelos. Typing non-uniform concurrent objects. In Proceedings of CONCUR’00, LNCS 1877, pages 474–488. Springer, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. C. V. Russo. The joins concurrency library. In Proceedings of PADL’07, LNCS 4354, pages 260–274. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. C. V. Russo. Join patterns for visual basic. In Proceedings of OOPSLA’08, pages 53–72. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. D. Sangiorgi and D. Walker. The Pi-Calculus - A theory of mobile processes. Cambridge University Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. S. Stork, P. Marques, and J. Aldrich. Concurrency by default: using permissions to express dataflow in stateful programs. In Proceedings of OOPSLA’09, pages 933–940. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. S. Stork, K. Naden, J. Sunshine, M. Mohr, A. Fonseca, P. Marques, and J. Aldrich. Æminium: A permission-based concurrent-by-default programming language approach. ACM Trans. Program. Lang. Syst., 36(1):2, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Trans. Software Eng., 12(1):157–171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. J. Sunshine, K. Naden, S. Stork, J. Aldrich, and É. Tanter. First-class state change in Plaid. In Proceedings of OOPSLA’11, pages 713–732. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. A. J. Turon and C. V. Russo. Scalable join patterns. In Proceedings of OOPSLA’11, pages 575–594. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. S. West, S. Nanz, and B. Meyer. Efficient and reasonable object-oriented concurrency. In Proceedings of PPoPP’15, pages 273–274, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The chemical approach to typestate-oriented programming

                    Recommendations

                    Comments

                    Login options

                    Check if you have access through your login credentials or your institution to get full access on this article.

                    Sign in

                    Full Access

                    • Published in

                      cover image ACM SIGPLAN Notices
                      ACM SIGPLAN Notices  Volume 50, Issue 10
                      OOPSLA '15
                      October 2015
                      953 pages
                      ISSN:0362-1340
                      EISSN:1558-1160
                      DOI:10.1145/2858965
                      • Editor:
                      • Andy Gill
                      Issue’s Table of Contents
                      • cover image ACM Conferences
                        OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
                        October 2015
                        953 pages
                        ISBN:9781450336895
                        DOI:10.1145/2814270

                      Copyright © 2015 ACM

                      Publisher

                      Association for Computing Machinery

                      New York, NY, United States

                      Publication History

                      • Published: 23 October 2015

                      Check for updates

                      Qualifiers

                      • research-article

                    PDF Format

                    View or Download as a PDF file.

                    PDF

                    eReader

                    View online with eReader.

                    eReader
                    About Cookies On This Site

                    We use cookies to ensure that we give you the best experience on our website.

                    Learn more

                    Got it!