From Data Types to Session Types---A Basis for Concurrency and Distribution

Lead Research Organisation: University of Edinburgh
Department Name: Sch of Informatics

Abstract

We aim to solve computing's most pressing problem - concurrency and distribution - by adapting one of computing's most successful concepts - the data type. Data types codify the structure of data; session types codify the structure of communication. Session types will enable a revolution in the development of concurrent and distributed software, making it cheaper to construct and maintain, and more reliable.

Concurrency and distribution are computing's most pressing problem: unless we discover a way to routinely and reliably build concurrent and distributed systems, a half century of unprecedented technical progress will draw to a close. We are approaching the 50th anniversary of Moore's Law, the observation that component counts and clock speeds double every 18 months. No exponential improvement can continue forever, and recently this rule has changed: clock speeds now remain fixed while the number of processors doubles, so exploitation of concurrency is essential. Meanwhile, everyone now has a computer in their pocket, and these computers depend crucially on communication to achieve their function. We inhabit a world of web applications, cloud services, and mobile apps: society increasingly depends on a technological infrastructure of concurrent and distributed systems.

Programming concurrent and distributed systems is notoriously difficult. Many solutions are based on shared memory, which requires the programmer to reason about every possible interleaving by which many processors access a common resource. Shared memory scales only to a certain point; it is not appropriate for programming the server farms that drive the web or for mobile applications. The most successful solutions so far appear to be those that replace shared memory with communication as the central structuring technique. Communication usually centres around the notion of a protocol, a series of operations in a specific order. However, direct support for protocols at the language level has been lacking, as compared with data types.

The data type is one of computing's most successful concepts. Data types appear from the oldest programming language to the newest, and cover concepts ranging from a single byte to organised tables containing information on customers and orders. Types act as the fundamental unit of compositionality: the first thing a programmer writes or reads about each method is its data type, and type discipline guarantees that each call of a method matches its definition. Data types play a central role in all aspects of software, from architectural design to interactive development environments to efficient compilation.

The analogue of the data type for concurrency and distribution is the session type. A session type codifies the notion of a protocol. Session types build on data types, as data types specify the lowest level of data exchange, upon which more complex protocols are built. Just as type discipline matches use and definition of a method, so session types ensure consistency between the two ends of a communication.

We expect session types to play a role in all aspects of software. Today, architects discuss the high-level structure of a system in terms of its types, but must resort to informal notions of protocol to describe communication; in future, they will describe communication in terms of session types. Today, programmers use tools that let them search for methods and modules based on their type, and give immediate feedback if their program violates type discipline, but must resort to informal notions of protocol when coding communications; in future, they will search for components based on their session type, and get immediate feedback if their program violates session type discipline. Today, software tools exploit types to optimise code, but cannot exploit the informal notions of protocol to optimise communication; in future, communication middleware will exploit session types to support efficient messaging.

Planned Impact

The programme is intended to establish a radically new programming methodology centring on session types, and design and build languages, tools and runtimes to enable their use by the standard software practice, as well as establishing theoretical foundations. This will have a far reaching impact on computing practice and on quality of software, in the short term (3 years), medium term (6 years) and long term (10 years and beyond).

(1) Who will benefit from this research?

In the short term, the beneficiaries will be the partners of this programme and those closely associated with them, including the web service and cloud computing platform from Amazon (Amazon Web Services, AWS), Qualit-E of Cognizant which provides defect analysis for large-scale enterprise software, large-scale E-Science infrastructure for ocean sciences and climate change (Ocean Observatories Initiative, OOI), Savara and other open-source projects in Red Hat, and VMware, a primary provider of cloud infrastructure. Each of them is a cutting edge engineering enterprise which centres on concurrency and distribution, and will directly benefit from our research accomplishments. This in turn will lead to a broader impact: for
example, AWS is one of the most widely used public web services with global user base, while OOI is a distributed observatory providing information from global oceans, which is vital for climate change.

In the medium term, our programming methodologies, languages and tools will become widely known outside of our partners, accompanying concrete usage scenarios. At this point, the ideas and tools will start to spread rapidly among aspiring engineers, including architects, analysts and programmers alike.

In the longer term, after the programme produces all of its key deliverables, their values will become appreciated among most software developers and all key personnel in IT divisions of cutting edge corporations. The time will be ripe for standardisation efforts for session-type-based technologies regarding e.g. quality assurance of components' behaviour and development process. These standardisations as well as the technologies themselves will have fundamental effects on all areas of computing and society, including citizens depending on ICT infrastructures for lifeline support.

(2) How will they benefit from this research?

The partners of this programme will benefit from their direct collaboration, and early access to the ideas, languages and tools, and will continue to be at the forefront of the software technologies exploiting the results of this collaboration.

For the adoption beyond our partners, the partners themselves will become one of the most effective channels. While new technologies in software often take time to become widely adopted, we believe that the urgency of working with concurrency and distribution will have an accelerating effect in the adoption of better and more powerful technologies. Once software developers start to use the session-type-based technologies from the programme, including programming languages and tools, developers and enterprises will quickly notice their benefits and will start to build development practice for their teams and organisations. This will also lead to the creation of a market for a new generation of software tools and methodologies.

In the long term, the effects will reach the public through two means. First, our provision of programming methods suited to concurrency and distribution will make it possible for new and versatile software products and services to appear and be used in public services. Second, improved safety and robustness of these software products will provide a higher quality of public service in the technological infrastructure that uses them.

Publications

10 25 50
publication icon
ABEL A (2020) Leibniz equality is isomorphic to Martin-Löf identity, parametrically in Journal of Functional Programming

publication icon
Ahmed A (2017) Theorems for free for free: parametricity, with and without types in Proceedings of the ACM on Programming Languages

publication icon
Ardeshir-Larijani E (2018) Automated Equivalence Checking of Concurrent Quantum Systems in ACM Transactions on Computational Logic

publication icon
Bartoletti M (2015) Choreographies in the wild in Science of Computer Programming

publication icon
Barwell A (2022) Book review in Journal of Logical and Algebraic Methods in Programming

publication icon
Bernardi G (2014) Trustworthy Global Computing

publication icon
Bocchi L (2017) Monitoring networks through multiparty session types in Theoretical Computer Science

publication icon
Bocchi L (2014) On the behaviour of general purpose applications on cloud storages in Service Oriented Computing and Applications

 
Description The data type is one of computing's most successful ideas. Types act
as the fundamental unit of compositionality: the first thing a
developer writes or reads about each method is the data types it acts
upon, and type discipline guarantees that each call of a method
is in accord with its type.

Session types are the analogue of data types for communication.
A session type will again act as a fundamental unit of compositionality:
the first thing a developer writes or reads about each process will
be the session types of its communications, and session type discipline
will guarantee that communications from different processes
are in accord with the session type.

ABCD has carried forward the above research programme with deep
insights into the logical structure of session types, with a series
of implementations in widely-used languages (including C, MPI, Erlang, Go,
Haskell, Java, and Python) and in specialist languages for session
types (such as Links), and with collaborations with industry.
Industrial applications of session types include the Scribble
specification language maintained by Red Hat, the design of
monitoring software used by the Ocean Observatories Initiative, and
analysis of microservices carried out by ThoughtWorks.

We have disseminated our results through academic publication, by
participating in summer schools, and by organising workshops:
CoCo, Loch Lomond (May 2014);
Shonan Workshop on Sofware Contracts for Communication, Monitoring, Security, Japan (May 2014);
Graduate Course on Session Types, L'Aquila (Italy) (June 2014);
BETTY Summer School, Lovran, Croatia (June-July 2014);
Formal Methods for the Design of Computer, Communication and Software Systems: Multicore Programming, Bertinoro, Italy, (June 2015)
DSLDI Summer School, Lausanne, Switzerland (July 2015);
SICSA Summer School on Practical Types, St Andrews (August 2015);
BETTY Summer School, Limassol, Cyprus (June--July 2016);
International Summer School on Metaprogramming, Cambridge (August 2016);
Dagstuhl Workshop on Theory and Application of Behavioural Types (January-February 2017),
Tutorial at International Symposium on Formal Methods (November 2017),
Tutorial at International Symposium on Code Generation and Optimization (February 2018),
Scottish Programming Languages and Verification Summer School, Glasgow (August 2019).


Additional details

CoCo, Loch Lomond (May 2014)

This was a one-day workshop funded by the Scottish Informatics
and Computer Science Alliance (SICSA), bringing together
researchers interested in Communication and Concurrency
(CoCo).

Shonan Workshop on Sofware Contracts for Communication, Monitoring, Security ; Japan (May 2014)

Professor Phil Wadler co-organised this workshop with
Professor Atsushi Igarashi (Kyoto) and Professor Peter
Thiemann (Freiburg). Professor Wadler, Professor Simon Gay,
and Professor Nobuko Yoshida all gave talks.

BETTY Summer School, Lovran, Croatia (June-July 2014)

This summer school was organised by Professor Simon Gay as
part of COST Action IC1201: Behavioural Types for Reliable
Large-Scale Software Systems (BETTY). Professor Phil Wadler,
Professor Nobuko Yoshida and Dr Raymond Hu (ABCD post-doc) all
gave lectures. Several of the ABCD post-docs and PhD students
attended.

DSLDI Summer School, Lausanne (July 2015)

Philip Wadler gave lectures.

SICSA Summer School on Practical Types, St Andrews (August 2015)

Dr Ornela Dardha lectured on session types.

BETTY Summer School, Limassol, Cyprus (June--July 2016)

This summer school was organised by Professor Simon Gay as
part of COST Action IC1201: Behavioural Types for Reliable
Large-Scale Software Systems (BETTY). Professor Phil Wadler,
Dr Ornela Dardha (ABCD post-doc) and Dr Raymond Hu (ABCD
post-doc) all gave lectures, as did Dr Laura Bocchi (former
ABCD post-doc). Several of the ABCD post-docs and PhD students
attended.

International Summer School on Metaprogramming, Cambridge (August 2016)

Philip Wadler and Sam Lindley gave lectures.

Dagstuhl Workshop on Theory and Application of Behavioural Types
(January-February 2017)

This workshop was organised by Professor Simon Gay, Professor
Philip Wadler, Professor Nobuko Yoshida and Professor Vasco
Vasconcelos (Lisbon). Several ABCD post-docs attended and gave
talks: Dr Dimitrios Kouzapas, Dr Alceste Scalas, Dr Nicholas
Ng, Dr Garrett Morris. Former ABCD post-docs also attended and
gave talks: Dr Laura Bocchi, Dr Dominic Orchard. ABCD visitor
Dr Antonio Ravara also attended. Additionally, academic advisors
Professor Frank Pfenning and Professor Mariangiola Dezani were also
among the attendees.

Scottish Programming Languages and Verification Summer School, Glasgow (August 2019).

Philip Wadler and Ornela Dardha gave lectures.

Lecture at 'Journées Francophones des Langages Applicatifs', JFLA 2016, Saint-Malo, France (January 2016)
University of Keio, Graduate School, Yokohama (Japan) (August 2016, 2017)
15th International School on Formal Methods for the Design of
Computer, Communication and Software Systems: Multicore Programming,
Bertinoro, Italy, (June 2015)
Graduate Course on Session Types, L'Aquila (Italy) (June 2014)
Exploitation Route We will continue to work with Red Hat, Cognizant, November Group, LLC
and WeaveWorks
Sectors Digital/Communication/Information Technologies (including Software)

URL http://groups.inf.ed.ac.uk/abcd/
 
Description Gary Brown of Red Hat maintains Scribble, a tool for specifying communication protocols using session types that was designed by the ABCD team and integrates with several ABCD research projects (from before start of ABCD to present). Matthew Arrott has applied work from Imperial on dynamic monitoring of session types in Python in monitoring software deployed by the Ocean Observatories initiative (2015). Steve Ross-Talbot of Thoughtworks and Estafet has employed session types in the analysis of Microservices (from January 2017). Session types have been applied to deadlock detection in the Go programming language, which was designed by Google and is in widespread use there and elsewhere. This work has been written up in a developers' blog [1] and highlighted by ACM [2], the main organisation of computing researchers and practitioners (February 2017). [1] https://blog.acolyer.org/2017/02/02/fencing-off-go-liveness-and-safety-for-channel-based-programming/ [2] https://www.linkedin.com/hp/update/6234050296415297536 Researchers from ABCD have been approached by the Go team at Google to advise on a design for adding generic types to Go, including Philip Wadler, Raymond Hu, Julien Lange, Nicholas Ng, Bernardo Toninho, and Nobuko Yoshida. Expertise developed during ABCD has been essential to this project. Several researchers in the ABCD project, including Fahd Abdeljallal, Nicholas Ng, Philip Wadler, and Nobuko Yoshida have spoken on session types and related subjects to developer conferences including: BuzzConf, Buenos Aires, Code Mesh, London; Curry On, London; Curry On, Prague; Full Stack Fest, Barcelona; F#unctional Londoners; Golang UK; Joy of Coding, Nijmegen; Lambda Days, Krakow; Lambda Jam, Melbourne; Lambda World, Cadiz; LambdUp, Prague; Strange Loop, St Louis (twice); QCon, London; QCon, San Francisco; QCon, Sao Paolo; and Yow!, Australia (from December 2013 to September 2019).
First Year Of Impact 2013
Sector Digital/Communication/Information Technologies (including Software),Environment
Impact Types Societal,Economic

 
Description Session Types for Reliable Distributed Systems (STARDUST)
Amount £563,806 (GBP)
Funding ID EP/T014628/1 
Organisation Engineering and Physical Sciences Research Council (EPSRC) 
Sector Public
Country United Kingdom
Start 09/2020 
End 09/2024
 
Title CAMP: Cost-Aware Multiparty Session Protocols (artifact) 
Description This is the artifact for the paper *CAMP: Cost-Aware Multiparty Session Protocols*.
The artifact comprises: - A library for specifying cost-aware multiparty protocols.
- The raw data used for comparing the cost models with real execution costs.
- The cost-aware protocol specifications of the benchmarks that we studied. The library for specifying cost-aware protocols also provides functions for
extracting cost equations from them, and for estimating recursive protocol
latencies (i.e. average cost per protocol iteration). We provide a script for
extracting cost equations, and instantiating them using the parameters used in
the paper.
 
Type Of Technology Software 
Year Produced 2020 
Open Source License? Yes  
URL https://zenodo.org/record/4046893
 
Title CAMP: Cost-Aware Multiparty Session Protocols (artifact) 
Description This is the artifact for the paper *CAMP: Cost-Aware Multiparty Session Protocols*.
The artifact comprises: - A library for specifying cost-aware multiparty protocols.
- The raw data used for comparing the cost models with real execution costs.
- The cost-aware protocol specifications of the benchmarks that we studied. The library for specifying cost-aware protocols also provides functions for
extracting cost equations from them, and for estimating recursive protocol
latencies (i.e. average cost per protocol iteration). We provide a script for
extracting cost equations, and instantiating them using the parameters used in
the paper.
 
Type Of Technology Software 
Year Produced 2020 
Open Source License? Yes  
URL https://zenodo.org/record/4046892
 
Description BETTY Summer School 2014 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Members of the project gave lectures at the 1st International Summer School on Behavioural Types: Professor Nobuko Yoshida, Professor Philip Wadler, Dr Raymond Hu. Advisory board members Professor Vasco Vasconcelos, Professor Mariangiola Dezani and Professor Frank Pfenning also gave lectures. The summer school was organised by Professor Simon Gay. There were around 35 participants, who were PhD students and post-doctoral researchers from across Europe.
Year(s) Of Engagement Activity 2014
URL http://summerschool2014.behavioural-types.eu
 
Description BETTY Summer School 2016 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Members of the project gave lectures at the 2nd International Summer School on Behavioural Types: Professor Philip Wadler, Dr Ornela Dardha, Dr Raymond Hu. Advisory board member Professor Vasco Vasconcelos and former project member Dr Laura Bocchi also gave lectures. The summer school was organised by Professor Simon Gay. There were around 35 participants, who were PhD students and post-doctoral researchers from across Europe.
Year(s) Of Engagement Activity 2016
URL http://summerschool2016.behavioural-types.eu
 
Description BuzzConf, Buenos Aires 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact BuzzConf, Buenos Aires, 12-14 June 2019. Keynote speaker.
Year(s) Of Engagement Activity 2019
URL https://buzzconf.org/
 
Description Curry On, London, 15-16 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Curry On, London, 15-16 July 2019. Invited speaker.
Year(s) Of Engagement Activity 2019
URL https://www.curry-on.org/2019/
 
Description Dagstuhl Workshop on Theory and Applications of Behavioural Types 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was a workshop at the Dagstuhl centre in Germany, for invited researchers working in behavioural types and related areas. There were 45 participants. The workshop was successful in sharing research results and discussing future directions for the research community. The workshop was organised by the project PIs: Professor Philip Wadler, Professor Nobuko Yoshida, Professor Simon Gay, and Advisory Board member Professor Vasco Vasconcelos. Several project members attended (Dr Dimitrios Kouzapas, Dr Garrett Morris, Dr Nicholas Ng, Dr Raymond Hu, Dr Alceste Scalas) as well as Advisory Board members Professor Mariangiola Dezani and Professor Frank Pfenning.
Year(s) Of Engagement Activity 2017
URL https://www.dagstuhl.de/en/program/calendar/semhp/?semnr=17051
 
Description Full Stack Fest, Barcelona 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Developer conference.
Year(s) Of Engagement Activity 2019
URL https://2019.fullstackfest.com/
 
Description IOHK Summit, Miami 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact IOHK Summit, Miami, 17-18 April 2019. Speaker. IOHK is a cryptocurrency firm. I consult on the design of their smart contract languages, Pluto and Marlowe.
Year(s) Of Engagement Activity 2019
URL https://iohksummit.io/
 
Description LEICESTER SUMMER SCHOOL: BEHAVIOURAL APPROACHES FOR API-ECONOMY WITH APPLICATIONS 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Dr Ornela Dardha lectured on session types at this summer school, which was organised by the EU MSCA RISE project BehAPI (Behavioural APIs). The participants were PhD students, researchers and industrial collaborators in the project.
Year(s) Of Engagement Activity 2019
URL https://www.um.edu.mt/projects/behapi/leicester-summer-school-behavioural-approaches-for-api-economy...
 
Description LambdUp, Prague 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact LambdUp, Prague, 13 September 2018. Keynote speaker.
Year(s) Of Engagement Activity 2018
URL https://www.lambdup.io/
 
Description Lambda Days, Krakow 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Lambda Days, Krakow, 22-23 February 2018. Keynote speaker.
Year(s) Of Engagement Activity 2018
URL http://www.lambdadays.org/lambdadays2018
 
Description Plutusfest, Edinburgh 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Plutusfest, Edinburgh, 11 December 2018. Keynote speaker. Plutusfest was sponsored by IOHK, a cryptocurrency firm. I consult with IOHK on the design of their smart contract languages, Plutus and Marlowe.
Year(s) Of Engagement Activity 2018
URL https://plutusfest.io/
 
Description Propositions as Types, CACM, December 2015. 
Form Of Engagement Activity A magazine, newsletter or online publication
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Propositions as Types, CACM, December 2015. Technical article in the most widely read publication of the Association for Computing Machinery.
Year(s) Of Engagement Activity 2015
URL https://cacm.acm.org/magazines/2015/12/194626-propositions-as-types/abstract
 
Description SICSA Summer School on Practical Types 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach National
Primary Audience Postgraduate students
Results and Impact Dr Ornela Dardha lectured on session types at the SICSA Summer School on Practical Types. The lectures informed participants about session types as part of the landscape of type systems in programming languages.
Year(s) Of Engagement Activity 2015
URL https://eb.host.cs.st-andrews.ac.uk/PracticalTypes/
 
Description Scottish Programming Languages and Verification Summer School 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Dr Ornela Dardha lectured on session types at the Scottish Programming Languages and Verification Summer School. This is likely to become a regular event, aimed at PhD students and researchers in programming languages and verification.
Year(s) Of Engagement Activity 2019
URL https://www.sicsa.ac.uk/events/scottish-programming-languages-and-verification-summer-school/
 
Description Scottish Programming Languages and Verification Summer School (SPLV) 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Scottish Programming Languages and Verification Summer School (SPLV), Strathclyde University, Glasgow, 5-9 August 2019.
Year(s) Of Engagement Activity 2019
URL http://www.macs.hw.ac.uk/splv/splv19/
 
Description Strange Loop, St Louis. 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Strange Loop, St Louis, 27-28 September 2018. Strange Loop is one of the most important developer conferences.
Year(s) Of Engagement Activity 2018
URL https://www.thestrangeloop.com/
 
Description Yow! Lambda Jam, Melbourne 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Yow! Lambda Jam, Melbourne, 13-15 May. Keynote
Year(s) Of Engagement Activity 2019
URL https://lambdajam.yowconference.com.au/