|
ABSTRACT
We describe an implementation of session types in Haskell. Session types statically enforce that client-server communication proceeds according to protocols. They have been added to several concurrent calculi, but few implementations of session types are available. Our embedding takes advantage of Haskell where appropriate, but we rely on no exotic features. Thus our approach translates with minimal modification to other polymorphic, typed languages such as ML and Java. Our implementation works with existing Haskell concurrency mechanisms, handles multiple communication channels and recursive session types, and infers protocols automatically. While our implementation uses unsafe operations in Haskell, it does not violate Haskell's safety guarantees. We formalize this claim in a concurrent calculus with unsafe communication primitives over which we layer our implementation of session types, and we prove that the session types layer is safe. In particular, it enforces that channel-based communication follows consistent protocols.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
|
| |
2
|
K. Asai and Y. Kameyama. Polymorphic delimited continuations. In Programming Languages and Systems, volume 4807 of Lecture Notes in Computer Science, pages 239--254. Springer-Verlag, 2007.
|
| |
3
|
R. Atkey. Parameterized notions of computation. In Proc. Workshop on Mathematically Structured Functional Programming (MSFP'06). BCS, 2006.
|
| |
4
|
E. Barendsen and S. Smetsers. Uniqueness typing for functional languages with graph rewriting semantics. Mathematical Structures in Computer Science, 6:579--612, 1996.
|
 |
5
|
Manuel M. T. Chakravarty , Gabriele Keller , Simon Peyton Jones , Simon Marlow, Associated types with class, Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.1-13, January 12-14, 2005, Long Beach, California, USA
|
 |
6
|
|
| |
7
|
M. Dezani-Ciancaglini, N. Yoshida, A. Ahern, and S. Drossopolou. A distributed object-oriented language with session types. In Proc. Symposium on Trustworthy Global Computing, volume 3706 of Lecture Notes in Computer Science. Springer-Verlag, 2005.
|
| |
8
|
M. Dezani-Ciancaglini, D. Mostrous, N. Yoshida, and S. Drossopolou. Session types for object-oriented languages. In Proc. European Conference on Object-Oriented Programming (ECOOP'06). Springer-Verlag, 2006.
|
 |
9
|
Manuel Fähndrich , Mark Aiken , Chris Hawblitzel , Orion Hodson , Galen Hunt , James R. Larus , Steven Levi, Language support for fast and reliable message-based communication in singularity OS, Proceedings of the 1st ACM SIGOPS/EuroSys European Conference on Computer Systems 2006, April 18-21, 2006, Leuven, Belgium
|
| |
10
|
|
| |
11
|
|
| |
12
|
S. J. Gay and V. T. Vasconcelos. Asynchronous functional session types. Technical Report 2007--251, Department of Computing, University of Glasgow, May 2007.
|
| |
13
|
J.-Y. Girard. Une extension de l'interprétation de Gödel à l'analyse, et son application à l'élimination des coupures dans l'analyse et la théorie des types. In J. E. Fenstad, editor, Proc. Second Scandinavian Logic Symposium, pages 63--92. North-Holland, 1971.
|
| |
14
|
J.-Y. Girard. Interprétation fonctionelle et élimination des coupures de l'arithmétique d'ordre supérieur. PhD thesis, Université Paris VI, 1972.
|
| |
15
|
|
 |
16
|
Tim Harris , Simon Marlow , Simon Peyton-Jones , Maurice Herlihy, Composable memory transactions, Proceedings of the tenth ACM SIGPLAN symposium on Principles and practice of parallel programming, June 15-17, 2005, Chicago, IL, USA
[doi> 10.1145/1065944.1065952]
|
| |
17
|
|
| |
18
|
|
| |
19
|
O. Kiselyov. Simple variable-state 'monad'. Mailing list message, December 2006. URL http://www.haskell.org/pipermail/haskell/2006-December/018917.html.
|
| |
20
|
O. Kiselyov. Genuine shift/reset in Haskell98. Mailing list message, December 2007. URL http://www.haskell.org/pipermail/haskell/2007-December/020034.html.
|
 |
21
|
|
| |
22
|
M. Neubauer and P. Thiemann. An implementation of session types. In Proc. 7th International Symposium on Practical Aspects of Declarative Languages (PADL'04), volume 3057 of Lecture Notes in Computer Science, pages 56--70, 2004.
|
 |
23
|
Simon Peyton Jones , Andrew Gordon , Sigbjorn Finne, Concurrent Haskell, Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.295-308, January 21-24, 1996, St. Petersburg Beach, Florida, United States
[doi> 10.1145/237721.237794]
|
| |
24
|
S. Peyton Jones, M. P. Jones, and E. Meijer. Type classes: An exploration of the design space, 1997.
|
| |
25
|
R. Pucella and A. Heller. Capability-based calculi for session types. Unpublished manuscript, 2008.
|
| |
26
|
|
 |
27
|
|
| |
28
|
|
 |
29
|
|
 |
30
|
|
| |
31
|
A. Vallecillo, V. T. Vasconcelos, and A. Ravara. Typing the behavior of objects and components using session types. In Proc. International Workshop on Foundations of Coordination Languages and Software Architectures, volume 68(3) of Electronic Notes in Theoretical Computer Science. Elsevier Science Publishers, 2003.
|
| |
32
|
|
| |
33
|
|
|