Type-driven Development of Concurrent Communicating Systems

Modern software systems rely on communication, for example mobile applcations communicating with a central server, distributed systems coordinaing a telecommunications network, or concurrent systems handling events and processes in a desktop application. However, reasoning about concurrent prgrams is hard, since we must reason about each process and the order in which communication might happen between processes. In this paper, I describe a type-driven approach to implementing communicating concurrent programs, using the dependently typed programming language Idris. I show how the type system can be used to describe resource access protocols (such as controlling access to a file handle) and verify that programs correctly follow those prtools. Finally, I show how to use the type system to reason about the order of communication between concurrent processes, ensuring that each end of a communication channel follows a defined protocol.

[1]  Ohad Kammar,et al.  Handlers in action , 2013, ICFP.

[2]  Peter Kilpatrick,et al.  A language-independent parallel refactoring framework , 2012, WRT '12.

[3]  Edwin Brady,et al.  Idris, a general-purpose dependently typed programming language: Design and implementation , 2013, Journal of Functional Programming.

[4]  Jonathan Aldrich,et al.  Typestate-oriented programming , 2009, OOPSLA Companion.

[5]  Gordon D. Plotkin,et al.  Handlers of Algebraic Effects , 2009, ESOP.

[6]  Andrej Bauer,et al.  Programming with algebraic effects and handlers , 2012, J. Log. Algebraic Methods Program..

[7]  David Raymond Christiansen Reflect on Your Mistakes ! Lightweight Domain-Specific Error Messages , 2014 .

[8]  Jim Larson Erlang for Concurrent Programming , 2008, ACM Queue.

[9]  Sam Lindley,et al.  A Semantics for Propositions as Sessions , 2015, ESOP.

[10]  Marcello M. Bonsangue,et al.  Distributed Computing Techniques , 2009 .

[11]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[12]  Marinus J. Plasmeijer,et al.  Uniqueness Typing Simplified , 2008, IFL.

[13]  Conor McBride,et al.  I Got Plenty o' Nuttin' , 2016, A List of Successes That Can Change the World.

[14]  Jeffrey I. Schiller,et al.  An Authentication Service for Open Network Systems. In , 1998 .

[15]  Joe Armstrong,et al.  Making reliable distributed systems in the presence of software errors , 2003 .

[16]  Nick Benton,et al.  Integrating Linear and Dependent Types , 2015, POPL.

[17]  Nobuko Yoshida,et al.  Multiparty asynchronous session types , 2008, POPL '08.

[18]  Nils Anders Danielsson Total parser combinators , 2010, ICFP '10.

[19]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[20]  Edwin Brady Resource-Dependent Algebraic Effects , 2014, Trends in Functional Programming.

[21]  Andrew D. Gordon,et al.  Cryptographic Verification by Typing for a Sample Protocol Implementation , 2011, FOSAD.

[22]  Martin Odersky,et al.  Scala Actors: Unifying thread-based and event-based programming , 2009, Theor. Comput. Sci..

[23]  Conor McBride,et al.  A List of Successes That Can Change the World , 2016, Lecture Notes in Computer Science.

[24]  Andrew D. Gordon,et al.  Authenticity by typing for security protocols , 2001, Proceedings. 14th IEEE Computer Security Foundations Workshop, 2001..

[25]  Edwin Brady,et al.  Programming and reasoning with algebraic effects and dependent types , 2013, ICFP.