Abstract
Session types provide a typing discipline for communication systems, and a number of programming languages are integrated with session types. This paper provides a survey of programming language implementations which use the structuring mechanism from multiparty session types (MPST). The theory of MPST guarantees that processes following a predefined communication protocol (a multiparty session) are free from communication errors and deadlocks. We discuss the top-down, bottom-up and hybrid MPST frameworks, and compare their positive and negative aspects, through a Rust MPST implementation framework, Rumpsteak. We also survey MPST implementations with dynamic (runtime) verification which target active object programming languages.
This research was funded in whole, or in part, by EPSRC EP/T006544/2, EP/K011715/1, EP/K034413/1, EP/L00058X/1, EP/N027833/2, EP/N028201/1, EP/T014709/2, EP/V000462/1, EP/X015955/1, NCSS/EPSRC VeTSS and Horizon EU TaRDIS 101093006.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The work in [22] is categorised as “dynamic verification” as its workflow is close to the approaches by Erlang and Python discussed in this subsection.
References
Banusic, G.B., Majumdar, R., Pirron, M., Schmuck, A., Zufferey, D.: PGCD: robot programming and verification with geometry, concurrency, and dynamics. In: Liu, X., Tabuada, P., Pajic, M., Bushnell, L. (eds.) Proceedings of the 10th ACM/IEEE International Conference on Cyber-Physical Systems, ICCPS 2019, Montreal, QC, Canada, 16–18 April 2019, pp. 57–66. ACM (2019)
Barwell, A., Scalas, A., Yoshida, N., Zhou, F.: Generalised multiparty session types with crash-stop failures. In: 33rd International Conference on Concurrency Theory. LIPIcs, vol. 243, pp. 35:1–35:25. Dagstuhl (2022)
Barwell, A.D., Hou, P., Yoshida, N., Zhou, F.: Designing asynchronous multiparty protocols with crash-stop failures. In: 37th European Conference on Object-Oriented Programming. LIPIcs, Schloss Dagstuhl-Leibniz-Zentrum f"ur Informatik (2023)
Bouma, J., de Gouw, S., Jongmans, S.S.: Multiparty session typing in Java, deductively. In: Sankaranarayanan, S., Sharygina, N. (eds.) TACAS 2023. LNCS, vol. 13994, pp. 19–27. Springer, Cham (2023)
Brand, D., Zafiropulo, P.: On communicating finite-state machines. J. ACM 30(2), 323–342 (1983). https://doi.org/10.1145/322374.322380
Castro-Perez, D., Hu, R., Jongmans, S.S., Ng, N., Yoshida, N.: Distributed programming using role-parametric session types in Go: statically-typed endpoint apis for dynamically-instantiated communication structures. Proc. ACM Program. Lang. 3(POPL), 29:1–29:30 (2019). https://doi.org/10.1145/3290342
Castro-Perez, D., Yoshida, N.: CAMP: cost-aware multiparty session protocol. In: OOPSLA 2020: Conference on Object-Oriented Programming Systems, Languages and Applications. PACMPL, vol. 4, pp. 155:1–155:30. ACM (2020)
Castro-Perez, D., Yoshida, N.: Compiling first-order functions to session-typed parallel code. In: 29th International Conference on Compiler Construction, CC 2020, pp. 143–154. ACM (2020)
Castro-Perez, D., Yoshida, N.: Dynamically updatable multiparty session protocols. In: 37th European Conference on Object-Oriented Programming (ECOOP 2023). Leibniz International Proceedings in Informatics (LIPIcs), Schloss Dagstuhl-Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2023)
W3C Web Services Choreography. http://www.w3.org/2002/ws/chor/
Cledou, G., Edixhoven, L., Jongmans, S.S., Proença, J.: API generation for multiparty session types, revisited and revised using scala 3. In: Ali, K., Vitek, J. (eds.) 36th European Conference on Object-Oriented Programming (ECOOP 2022). Leibniz International Proceedings in Informatics (LIPIcs), vol. 222, pp. 27:1–27:28. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2022). https://doi.org/10.4230/LIPIcs.ECOOP.2022.27. https://drops.dagstuhl.de/opus/volltexte/2022/16255
Cutner, Z., Yoshida, N.: Safe session-based asynchronous coordination in rust. In: Damiani, F., Dardha, O. (eds.) COORDINATION 2021. LNCS, vol. 12717, pp. 80–89. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-78142-2_5
Cutner, Z., Yoshida, N., Vassor, M.: Deadlock-free asynchronous message reordering in rust with multiparty session types. In: 27th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. ACM (2022). arxiv:2112.12693
Demangeon, R., Honda, K.: Nested protocols in session types. In: Koutny, M., Ulidowski, I. (eds.) CONCUR 2012. LNCS, vol. 7454, pp. 272–286. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32940-1_20
Demangeon, R., Honda, K., Hu, R., Neykova, R., Yoshida, N.: Practical interruptible conversations: distributed dynamic verification with multiparty session types and python. Formal Methods Syst. Des. 46(3), 197–225 (2015). https://doi.org/10.1007/s10703-014-0218-8
Deniélou, P., Yoshida, N.: Dynamic multirole session types. In: Ball, T., Sagiv, M. (eds.) Proceedings of the 38th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2011, Austin, TX, USA, 26–28 January 2011, pp. 435–446. ACM (2011). https://doi.org/10.1145/1926385.1926435
Estafet: Managing distributed systems using Scribble (2017). https://www.youtube.com/watch?v=_qB2jV5SKwA
Fowler, S.: An erlang implementation of multiparty session actors. Electron. Proc. Theor. Comput. Sci. 223, 36–50 (2016). https://doi.org/10.4204/eptcs.223.3
Gabet, J., Yoshida, N.: Static race detection and mutex safety and liveness for go programs. In: 34th European Conference on Object-Oriented Programming. LIPIcs, vol. 166, pp. 4:1–4:30. Schloss Dagstuhl-Leibniz-Zentrum f"ur Informatik (2020)
Gheri, L., Lanese, I., Sayers, N., Tuosto, E., Yoshida, N.: Design-by-contract for flexible multiparty session protocols. In: 36th European Conference on Object-Oriented Programming. LIPIcs, vol. 222, pp. 8:1–8:28. Schloss Dagstuhl-Leibniz-Zentrum fur Informatik (2022)
Ghilezan, S., Pantović, J., Prokić, I., Scalas, A., Yoshida, N.: Precise subtyping for asynchronous multiparty sessions. ACM Trans. Comput. Log. (2023). https://doi.org/10.1145/3568422
Hähnle, R., Haubner, A.W., Kamburjan, E.: Locally static, globally dynamic session types for active objects. In: de Boer, F.S., Mauro, J. (eds.) Recent Developments in the Design and Implementation of Programming Languages. OpenAccess Series in Informatics (OASIcs), vol. 86, pp. 1:1–1:24. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2020). https://doi.org/10.4230/OASIcs.Gabbrielli.1. https://drops.dagstuhl.de/opus/volltexte/2020/13223
Hamers, R., Jongmans, S.-S.: Discourje: runtime verification of communication protocols in clojure. In: TACAS 2020. LNCS, vol. 12078, pp. 266–284. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-45190-5_15
Harvey, P., Fowler, S., Dardha, O., J. Gay, S.: Multiparty session types for safe runtime adaptation in an actor language. In: Møller, A., Sridharan, M. (eds.) 35th European Conference on Object-Oriented Programming (ECOOP 2021). Leibniz International Proceedings in Informatics (LIPIcs), vol. 194, p. 30. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, Dagstuhl (2021). https://doi.org/10.4230/LIPIcs.ECOOP.2021.12. https://2021.ecoop.org/details/ecoop-2021-ecoop-research-papers/12/Multiparty-Session-Types-for-Safe-Runtime-Adaptation-in-an-Actor-Language
Henriksen, A.S., Nielsen, L., Hildebrandt, T.T., Yoshida, N., Henglein, F.: Trustworthy pervasive healthcare services via multiparty session types. In: Weber, J., Perseil, I. (eds.) FHIES 2012. LNCS, vol. 7789, pp. 124–141. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39088-3_8
Honda, K., Mukhamedov, A., Brown, G., Chen, T.-C., Yoshida, N.: Scribbling interactions with a formal foundation. In: Natarajan, R., Ojo, A. (eds.) ICDCIT 2011. LNCS, vol. 6536, pp. 55–75. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-19056-8_4
Honda, K., Vasconcelos, V.T., Kubo, M.: Language primitives and type discipline for structured communication-based programming. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, pp. 122–138. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0053567
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. In: POPL, pp. 273–284. ACM Press (2008). https://doi.org/10.1145/1328438.1328472
Honda, K., Yoshida, N., Carbone, M.: Multiparty asynchronous session types. JACM 63, 1–67 (2016)
Hu, R., Yoshida, N.: Hybrid session verification through endpoint API generation. In: Stevens, P., Wasowski, A. (eds.) FASE 2016. LNCS, vol. 9633, pp. 401–418. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49665-7_24
Hu, R., Yoshida, N.: Explicit connection actions in multiparty session types. In: Huisman, M., Rubin, J. (eds.) FASE 2017. LNCS, vol. 10202, pp. 116–133. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54494-5_7
Hu, R., Yoshida, N., Honda, K.: Session-based distributed programming in java. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 516–541. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-70592-5_22
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight java: a minimal core calculus for java and GJ. ACM TOPLAS 23(3), 396–450 (2001). https://doi.org/10.1145/503502.503505
Imai, K., Lange, J., Neykova, R.: Kmclib: automated inference and verification of session types from OCaml programs. In: TACAS 2022. LNCS, vol. 13243, pp. 379–386. Springer, Cham (2022). https://doi.org/10.1007/978-3-030-99524-9_20
Imai, K., Neykova, R., Yoshida, N., Yuen, S.: Multiparty session programming with global protocol combinators. In: Hirschfeld, R., Pape, T. (eds.) 34th European Conference on Object-Oriented Programming (ECOOP 2020). Leibniz International Proceedings in Informatics (LIPIcs), vol. 166, pp. 9:1–9:30. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, Dagstuhl (2020). https://doi.org/10.4230/LIPIcs.ECOOP.2020.9. https://drops.dagstuhl.de/opus/volltexte/2020/13166
Jacobs, J., Balzer, S., Krebbers, R.: Multiparty GV: functional multiparty session types with certified deadlock freedom. Proc. ACM Program. Lang. 6(ICFP) (2022). https://doi.org/10.1145/3547638
Johnsen, E.B., Hähnle, R., Schäfer, J., Schlatte, R., Steffen, M.: ABS: a core language for abstract behavioral specification. In: Aichernig, B.K., de Boer, F.S., Bonsangue, M.M. (eds.) FMCO 2010. LNCS, vol. 6957, pp. 142–164. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-25271-6_8
Kamburjan, E., Din, C.C., Chen, T.-C.: Session-based compositional analysis for actor-based languages using futures. In: Ogata, K., Lawford, M., Liu, S. (eds.) ICFEM 2016. LNCS, vol. 10009, pp. 296–312. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-47846-3_19
King, J., Ng, N., Yoshida, N.: Multiparty session type-safe web development with static linearity. In: Programming Language Approaches to Concurrency and Communication-cEntric Software, vol. 291, pp. 35–46. Open Publishing Association (2019)
Kouzapas, D., Dardha, O., Perera, R., Gay, S.J.: Typechecking protocols with mungo and StMungo. In: Proceedings of the 18th International Symposium on Principles and Practice of Declarative Programming, PPDP 2016, pp. 146–159. Association for Computing Machinery, New York (2016). https://doi.org/10.1145/2967973.2968595
Lagaillardie, N., Neykova, R., Yoshida, N.: Stay safe under panic: affine rust programming with multiparty session types. In: 36th European Conference on Object-Oriented Programming. LIPIcs, vol. 222, pp. 4:1–4:29. Schloss Dagstuhl-Leibniz-Zentrum f"ur Informatik (2022)
Lange, J., Ng, N., Toninho, B., Yoshida, N.: Fencing off go: liveness and safety for channel-based programming. In: 44th ACM SIGPLAN Symposium on Principles of Programming Languages, pp. 748–761. ACM (2017)
Lange, J., Ng, N., Toninho, B., Yoshida, N.: A static verification framework for message passing in go using behavioural types. In: 40th International Conference on Software Engineering, pp. 1137–1148. ACM (2018)
Lange, J., Tuosto, E., Yoshida, N.: From communicating machines to graphical choreographies. In: POPL, pp. 221–232 (2015). https://doi.org/10.1145/2676726.2676964
Lange, J., Yoshida, N.: On the undecidability of asynchronous session subtyping. In: Esparza, J., Murawski, A.S. (eds.) FoSSaCS 2017. LNCS, vol. 10203, pp. 441–457. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3-662-54458-7_26
Lange, J., Yoshida, N.: Verifying asynchronous interactions via communicating session automata. In: Dillig, I., Tasiran, S. (eds.) CAV 2019. LNCS, vol. 11561, pp. 97–117. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-25540-4_6
López, H.A., et al.: Protocol-based verification of message-passing parallel programs. In: 2015 ACM International Conference on Object Oriented Programming Systems Languages and Applications/SPLASH 2015, pp. 280–298. ACM (2015)
Majumdar, R., Pirron, M., Yoshida, N., Zufferey, D.: Motion session types for robotic interactions. In: Proceedings of the 33rd European Conference on Object-Oriented Programming (ECOOP 2019). LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2019)
Majumdar, R., Yoshida, N., Zufferey, D.: Multiparty motion coordination: from choreographies to robotics programs. In: OOPSLA 2020: Conference on Object-Oriented Programming Systems, Languages and Applications. PACMPL, vol. 4, pp. 134:1–134:30. ACM (2020)
MCRL2 home page. https://www.mcrl2.org/web/user_manual/index.html
Miu, A., Ferreira, F., Yoshida, N., Zhou, F.: Communication-safe web programming in typescript with routed multiparty session types. In: International Conference on Compiler Construction, pp. 94–106. CC (2021)
Montesi, F.: Introduction to Choreographies. CUP (2023)
de Muijnck-Hughes, J., Vanderbauwhede, W.: A typing discipline for hardware interfaces. In: Donaldson, A.F. (ed.) 33rd European Conference on Object-Oriented Programming (ECOOP 2019). Leibniz International Proceedings in Informatics (LIPIcs), vol. 134, pp. 6:1–6:27. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, Dagstuhl (2019). https://doi.org/10.4230/LIPIcs.ECOOP.2019.6. http://drops.dagstuhl.de/opus/volltexte/2019/10798
Neykova, R., Bocchi, L., Yoshida, N.: Timed runtime monitoring for multiparty conversations. Formal Asp. Comput. 29(5), 877–910 (2017)
Neykova, R., Hu, R., Yoshida, N., Abdeljallal, F.: A session type provider: compile-time API generation for distributed protocols with interaction refinements in F#. In: 27th International Conference on Compiler Construction, pp. 128–138. ACM (2018)
Neykova, R., Yoshida, N.: Let it recover: multiparty protocol-induced recovery. In: Compiler Construction, pp. 98–108. ACM (2017)
Neykova, R., Yoshida, N.: Multiparty session actors. Logical Methods Comput. Sci. 13(1) (2017). https://doi.org/10.23638/LMCS-13(1:17)2017
Ng, N., de Figueiredo Coutinho, J.G., Yoshida, N.: Protocols by default. In: Franke, B. (ed.) CC 2015. LNCS, vol. 9031, pp. 212–232. Springer, Heidelberg (2015). https://doi.org/10.1007/978-3-662-46663-6_11
Ng, N., Yoshida, N.: Static deadlock detection for concurrent go by global session graph synthesis. In: 25th International Conference on Compiler Construction, pp. 174–184. ACM (2016)
Ng, N., Yoshida, N., Honda, K.: Multiparty session C: safe parallel programming with message optimisation. In: Furia, C.A., Nanz, S. (eds.) TOOLS 2012. LNCS, vol. 7304, pp. 202–218. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30561-0_15
Nielsen, L., Yoshida, N., Honda, K.: Multiparty symmetric sum types. In: Fröschle, S.B., Valencia, F.D. (eds.) Proceedings 17th International Workshop on Expressiveness in Concurrency, EXPRESS 2010, Paris, France, 30 August 2010. EPTCS, vol. 41, pp. 121–135 (2010). https://doi.org/10.4204/EPTCS.41.9
Niu, X., Ng, N., Yuki, T., Wang, S., Yoshida, N., Luk, W.: EURECA compilation: automatic optimisation of cycle-reconfigurable circuits. In: 26th International Conference on Field Programmable Logic and Applications, pp. 1–4. IEEE (2016)
nuScr home page. http://nuscr.dev/nuscr/
Ocean Observatories Initiative home page. https://oceanobservatories.org/
Scalas, A., Dardha, O., Hu, R., Yoshida, N.: A linear decomposition of multiparty sessions for safe distributed programming. In: ECOOP. LIPIcs, vol. 74, pp. 24:1–24:31. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2017). https://doi.org/10.4230/LIPIcs.ECOOP.2017.24
Scalas, A., Yoshida, N.: Less is more: multiparty session types revisited. Proc. ACM Program. Lang. 3(POPL), 30:1–30:29 (2019). https://doi.org/10.1145/3290343
Scalas, A., Yoshida, N., Benussi, E.: Verifying message-passing programs with dependent behavioural types. In: Programming Language Design and Implementation, pp. 502–516. ACM (2019)
Takeuchi, K., Honda, K., Kubo, M.: An interaction-based language and its typing system. In: PARLE 1994, LNCS, vol. 817, pp. 398–413 (1994). https://doi.org/10.1007/3540581847118
The Rust Project Developers: Procedural Macros. https://doc.rust-lang.org/reference/procedural-macros.html
Tirore, D., Bengtson, J., Carbone, M.: A sound and complete projection for global types. In: ITP 2023. LIPIcs, Schloss Dagstuhl (2023)
Viering, M., Hu, R., Eugster, P., Ziarek, L.: A multiparty session typing discipline for fault-tolerant event-driven distributed programming. Proceedings of the ACM on Programming Languages 5(OOPSLA), 1–30 (2021). https://doi.org/10.1145/3485501
Wadler, P.: Propositions as sessions. JFP 24(2–3), 384–418 (2014). https://doi.org/10.1017/S095679681400001X
Yoshida, N., Hu, R., Neykova, R., Ng, N.: The scribble protocol language. In: Abadi, M., Lluch Lafuente, A. (eds.) TGC 2013. LNCS, vol. 8358, pp. 22–41. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-05119-2_3
Yoshida, N., Vasconcelos, V., Paulino, H., Honda, K.: Session-based compilation framework for multicore programming. In: de Boer, F.S., Bonsangue, M.M., Madelaine, E. (eds.) FMCO 2008. LNCS, vol. 5751, pp. 226–246. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04167-9_12
Yoshida, N., Zhou, F., Ferreira, F.: Communicating finite state machines and an extensible toolchain for multiparty session types. In: Bampis, E., Pagourtzis, A. (eds.) FCT 2021. LNCS, vol. 12867, pp. 18–35. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-86593-1_2
Zhou, F., Ferreira, F., Hu, R., Neykova, R., Yoshida, N.: Statically verified refinements for multiparty protocols. Proc. ACM Program. Lang. 4(OOPSLA) (2020). https://doi.org/10.1145/3428216
Acknowledgements
We deeply thank the AOL reviewers for helpful and detailed comments, pointing out several missing literature.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
Cite this chapter
Yoshida, N. (2024). Programming Language Implementations with Multiparty Session Types. In: de Boer, F., Damiani, F., Hähnle, R., Broch Johnsen, E., Kamburjan, E. (eds) Active Object Languages: Current Research Trends. Lecture Notes in Computer Science, vol 14360. Springer, Cham. https://doi.org/10.1007/978-3-031-51060-1_6
Download citation
DOI: https://doi.org/10.1007/978-3-031-51060-1_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-51059-5
Online ISBN: 978-3-031-51060-1
eBook Packages: Computer ScienceComputer Science (R0)