main.pdf (716.9 kB)
Asynchronous sessions with implicit functions and messages
journal contribution
posted on 2023-06-09, 17:34 authored by Alexander Jeffery, Martin BergerMartin BergerSession types are a well-established approach to ensuring protocol conformance and the absence of communication errors such as deadlocks in message passing systems. Haskell introduced implicit parameters, Scala popularised this feature and recently gave implicit types first-class status, yielding an expressive tool for handling context dependencies in a type-safe yet terse way. We ask: can type-safe implicit functions be generalised from Scala's sequential setting to message passing computation? We answer this question in the affirmative by generalising the concept of an implicit function to an implicit message, its concurrent analogue. We present two calculi, each with implicit message passing. The first, Im, is a concurrent functional language that extends Gay and Vasconcelos's calculus of linear types for asynchronous sessions (Last) with implicit functions and messages. The second, MpIm, is a p-calculus with implicit messages that extends Coppo, Dezani-Ciancaglini, Padovani and Yoshida's calculus of multiparty asynchronous sessions (Mpst ). We argue, via examples, that these new language features provide utility to the programmer, and prove each system sound by translation into its respective base calculus.
History
Publication status
- Published
File Version
- Accepted version
Journal
Science of Computer ProgrammingISSN
0167-6423Publisher
ElsevierExternal DOI
Department affiliated with
- Informatics Publications
Research groups affiliated with
- Foundations of Software Systems Publications
Full text available
- Yes
Peer reviewed?
- Yes