Effects as sessions, sessions as effects

被引:0
作者
Orchard D. [1 ]
Yoshida N. [1 ]
机构
[1] Orchard, Dominic
[2] Yoshida, Nobuko
来源
| 1600年 / Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States卷 / 51期
基金
英国工程与自然科学研究理事会;
关键词
Concurrent Haskell; Effect systems; Encoding; PCF; Session types; Type systems; π-calculus;
D O I
10.1145/2837614.2837634
中图分类号
学科分类号
摘要
Effect and session type systems are two expressive behavioural type systems. The former is usually developed in the context of the λ- calculus and its variants, the latter for the π-calculus. In this paper we explore their relative expressive power. Firstly, we give an embedding from PCF, augmented with a parameterised effect system, into a session-typed π-calculus (session calculus), showing that session types are powerful enough to express effects. Secondly, we give a reverse embedding, from the session calculus back into PCF, by instantiating PCF with concurrency primitives and its effect system with a session-like effect algebra; effect systems are powerful enough to express sessions. The embedding of session types into an effect system is leveraged to give a new implementation of session types in Haskell, via an effect system encoding. The correctness of this implementation follows from the second embedding result. We also discuss various extensions to our embeddings. Copyright is held by the owner/author(s).
引用
收藏
页码:568 / 581
页数:13
相关论文
共 57 条
  • [1] Abramsky S., Jagadeesan R., Malacaria P., Full abstraction for PCF, TCS, 163, pp. 409-470, (2000)
  • [2] Atkey R., Parameterised notions of computation, Journal of Functional Programming, 19, 3-4, pp. 335-376, (2009)
  • [3] Bauer A., Pretnar M., Programming with algebraic effects and handlers, JLAMP, 84, 1, pp. 108-123, (2015)
  • [4] Berger M., Honda K., Yoshida N., Sequentiality and the λ-calculus, Proc. TLCA'01, pp. 29-45, (2001)
  • [5] Berger M., Honda K., Yoshida N., Genericity and the pi-calculus, Acta Inf., 42, 2-3, pp. 83-141, (2005)
  • [6] Caires L., Perez J.A., Pfenning F., Toninho B., Behavioral polymorphism and parametricity in session-based communication, ESOP, pp. 330-349, (2013)
  • [7] Caires L., Pfenning F., Session types as intuitionistic linear propositions, CONCUR, pp. 222-236, (2010)
  • [8] Capecchi S., Giachino E., Yoshida N., Global escape in multiparty sessions, MSCS, 29, pp. 1-50, (2015)
  • [9] Carbone M., Honda K., Yoshida N., Structured interactional exceptions in session types, CONCUR, pp. 402-417, (2008)
  • [10] Carbone M., Honda K., Yoshida N., Structured communication-centered programming for web services, TOPLAS, 34, pp. 81-878, (2012)