Implementing Algebraic Effects in C - "Monads for Free in C"

Implementing Algebraic Effects in C - "Monads for Free in C"
复制标题

在 C 中实现代数效应 - “Monads for Free in C”

DOI:
10.1007/978-3-319-71237-6_17
复制
发表时间:
2017
期刊:
Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
影响因子:
--
通讯作者:
Daan Leijen
Daan Leijen
中科院分区:
--
文献类型:
--
作者:
Daan Leijen

文献摘要

参考文献

被引文献

相似文献

我们将代数效果和处理程序的实现描述为标准和可移植C99中的库,其中效果操作可以像常规C函数一样使用。我们使用正式的操作语义来指导C实现的每一步,其中计算上下文直接对应于特定的C执行上下文。最后,我们给出了对优化后的尾部恢复语义的一种新的扩展,并证明了它的合理性。这使得尾部恢复操作的性能提高了两个数量级(在一个Core上每秒最多可达到1.5亿次操作i7@2.6GHz)。
We describe an implementation of algebraic effects and handlers as a library in standard and portable C99, where effect operations can be used just like regular C functions. We use a formal operational semantics to guide the C implementation at every step where an evaluation context corresponds directly to a particular C execution context. Finally we show a novel extension to the semantics for optimized tail resumptions and prove it sound. This gives two orders of magnitude improvement to the performance of tail resumptive operations (up to about 150 million operations per second on a Core i7@2.6GHz).
处理程序在行动
DOI: 10.1145/2500365.2500590
发表时间: 2013
期刊: --
影响因子: --
作者:
Kammar O
通讯作者: Kammar O
关于用户定义效果的表现力:效果处理程序、单子反射、分隔控制
DOI: 10.1145/3110257
发表时间: 2017
影响因子: --
作者:
Forster Y
通讯作者: Forster Y
做是做是做
DOI: 10.1145/3009837.3009897
发表时间: 2017
期刊: --
影响因子: --
作者:
Lindley S
通讯作者: Lindley S