Haskell Session Types with (Almost) No Class

被引:0
作者
Pucella, Riccardo [1 ]
Tov, Jesse A. [1 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
关键词
Languages; Session types; concurrency; Haskell; type classes; phantom types; functional programming; embedded type systems; LANGUAGE;
D O I
10.1145/1543134.1411290
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:25 / 36
页数:12
相关论文
共 32 条
  • [1] [Anonymous], 1974, LNCS
  • [2] [Anonymous], 2005, P GT2005 ASME TURB E
  • [3] [Anonymous], P 1 ACM SIGOPS EUROS
  • [4] Armstrong J., 2002, Proceedings of the 2002 ACM SIGPLAN workshop on Erlang, P64
  • [5] Asai K, 2007, LECT NOTES COMPUT SC, V4807, P239
  • [6] Atkey Robert, 2006, P WORKSH MATH STRUCT
  • [7] Barendsen E., 1996, Mathematical Structures in Computer Science, V6, P579
  • [8] DELINE R, 2001, P 2001 ACM SIGPLAN C
  • [9] DEZANICIANCAGLI.M, 2005, LECT NOTES COMPUTER, V3706
  • [10] DEZANICIANCAGLI.M, 2006, P EUR C OBJ OR PROGR