Effpi: verified message-passing programs in Dotty

We present Effpi: an experimental toolkit for strongly-typed concurrent and distributed programming in Dotty, with verification capabilities based on type-level model checking. Effpi addresses a main challenge in creating and maintaining concurrent programs: errors like protocol violations, deadlocks, and livelocks are often spotted late, at run-time, when applications are tested or (worse) deployed. Effpi aims at finding them early, when code is written and compiled. Effpi provides: (1) a set of Dotty classes for describing communication protocols as types; (2) an embedded DSL for concurrent programming, with process-based and actor-based abstractions; (3) a Dotty compiler plugin to verify whether protocols and programs enjoy desirable properties, such as deadlock-freedom; and (4) an efficient run-time system for executing Effpi's DSL-based programs. The combination of (1) and (2) allows the Dotty compiler to check whether an Effpi program implements a desired protocol/-type; and this, together with (3), means that many typical concurrent programming errors are found and ruled out at compile-time. Further, (4) allows to run highly concurrent Effpi programs with millions of interacting processes/actors, by scheduling them on a limited number of CPU cores. In this paper, we give an overview of Effpi, illustrate its design and main features, and discuss its future.

[1]  Nobuko Yoshida,et al.  Lightweight Session Programming in Scala , 2016, ECOOP.

[2]  Nobuko Yoshida,et al.  Lightweight Session Programming in Scala (Artifact) , 2016, Dagstuhl Artifacts Ser..

[3]  Nobuko Yoshida,et al.  Verifying message-passing programs with dependent behavioural types , 2019, PLDI.

[4]  Jan Friso Groote,et al.  Modeling and Analysis of Communicating Systems , 2014 .

[5]  Martin Odersky,et al.  Spores: A Type-Based Foundation for Closures in the Age of Concurrency and Distribution , 2014, ECOOP.

[6]  Nobuko Yoshida,et al.  A Linear Decomposition of Multiparty Sessions for Safe Distributed Programming , 2017, ECOOP.

[7]  Kohei Honda,et al.  Types for Dyadic Interaction , 1993, CONCUR.

[8]  Sam Lindley,et al.  Behavioural Types: from Theory to Tools , 2017 .

[9]  Davide Sangiorgi,et al.  The Pi-Calculus - a theory of mobile processes , 2001 .

[10]  Raheel Ahmad,et al.  The π-Calculus: A theory of mobile processes , 2008, Scalable Comput. Pract. Exp..

[11]  Jeffrey H. Meyerson,et al.  The Go Programming Language , 2014, IEEE Softw..

[12]  Brian W. Kernighan,et al.  The Go Programming Language , 2015 .

[13]  Philip Wadler,et al.  Typecasting actors: from Akka to TAkka , 2014, SCALA@ECOOP.

[14]  Davide Ancona,et al.  Behavioral Types in Programming Languages , 2016, Found. Trends Program. Lang..

[15]  Erik P. de Vink,et al.  An Overview of the mCRL2 Toolset and Its Recent Advances , 2013, TACAS.

[16]  Nobuko Yoshida,et al.  A Linear Decomposition of Multiparty Sessions for Safe Distributed Programming (Artifact) , 2017, Dagstuhl Artifacts Ser..

[17]  Nobuko Yoshida,et al.  Less is more: multiparty session types revisited , 2019, Proc. ACM Program. Lang..

[18]  Martin Odersky,et al.  Simplicitly: foundations and applications of implicit function types , 2017, Proc. ACM Program. Lang..

[19]  Luca Padovani,et al.  A Gentle Introduction to Multiparty Asynchronous Session Types , 2015, SFM.