Coeffects

Coeffects
复制标题

协同效应

DOI:
--
复制
发表时间:
2014
期刊:
ACM SIGPLAN International Conference on Functional Programming
影响因子:
--
通讯作者:
A. Mycroft
A. Mycroft
中科院分区:
--
文献类型:
--
作者:
T. Petříček;Dominic A. Orchard;A. Mycroft

文献摘要

被引文献

相似文献

函数语言中的上下文概念不再仅仅指作用域中的变量。上下文可以捕获变量的其他属性(线性逻辑中的使用模式; XML语言中的缓存要求)以及执行环境的其他资源或属性(可重新绑定的资源;跨平台应用程序中的平台版本)。最近引入的coeffects概念捕获了后者,整体上下文属性,但它未能捕获细粒度的每个变量属性。我们通过开发一个通用的coeffect系统来解决这个问题,该系统的注释由coeffect形状索引。通过实例化一个具体的形状,我们的系统捕获了以前研究过的平面(整体背景)协同效应,但也有结构(每变量)协同效应,使协同效应分析更有用。我们发现,结构系统享有理想的句法属性,我们给一个范畴语义使用扩展的概念索引comonad。在本文中提出的例子是基于分析建立的语言功能(活性,线性逻辑,低,动态范围),我们认为,这种上下文感知的属性也将是有用的语言越来越异构和分布式平台的未来发展。
The notion of context in functional languages no longer refers just to variables in scope. Context can capture additional properties of variables (usage patterns in linear logics; caching requirements in dataflow languages) as well as additional resources or properties of the execution environment (rebindable resources; platform version in a cross-platform application). The recently introduced notion of coeffects captures the latter, whole-context properties, but it failed to capture fine-grained per-variable properties. We remedy this by developing a generalized coeffect system with annotations indexed by a coeffect shape. By instantiating a concrete shape, our system captures previously studied flat (whole-context) coeffects, but also structural (per-variable) coeffects, making coeffect analyses more useful. We show that the structural system enjoys desirable syntactic properties and we give a categorical semantics using extended notions of indexed comonad. The examples presented in this paper are based on analysis of established language features (liveness, linear logics, dataflow, dynamic scoping) and we argue that such context-aware properties will also be useful for future development of languages for increasingly heterogeneous and distributed platforms.