A future is an entity representing the result of an ongoing computation. A synchronisation with a "get" operation blocks the caller until the computation is over, to return the corresponding value. When a computation in charge of fulfilling a future delegates part of its processing to another task, mainstream languages return nested futures, and several "get" operations are needed to retrieve the computed value (we call such futures "control-flow futures"). Several approaches were proposed to tackle this issues: the "forward" construct, that allows the programmer to make delegation explicit and avoid nested futures, and "data-flow explicit futures" which natively collapse nested futures into plain futures. This paper supports the claim that data-flow explicit futures form a powerful set of language primitives, on top of which other approaches can be built. We prove the equivalence, in the context of data-flow explicit futures, between the "forward" construct and classical "return" from functions. The proof relies on a branching bisimulation between a program using "forward" and its "return" counterpart. This result allows language designers to consider "forward" as an optimisation directive rather than as a language primitive. Following the principles of the Godot system, we provide a library implementation of control-flow futures, based on data-flow explicit futures implemented in the compiler. This small library supports the claim that the implementation of classical futures based on data-flow ones is easier than the opposite. Our benchmarks show the viability of the approach from a performance point of view.


翻译:未来是一个代表持续计算结果的实体 。 与“ 获取” 操作同步, 将调用器阻塞到计算完成之前的调用器, 返回相应的值 。 当一个计算负责完成未来代表处理中的一部分任务时, 主流语言返回嵌套的未来, 并且需要几个“ 获取” 操作来检索计算值( 我们称之为“ 控制- 流未来 ” ) 。 为了解决这个问题, 提出了几种方法 : “ 向前” 构造, 使程序设计器能够使授权明确, 避免嵌套未来, 并返回相应的值。 当程序设计器在本地崩溃后, 将“ 嵌入未来未来” 时, 返回相应的“ 明确未来 未来 ” 。 本文支持数据流明确未来 构成一套强大的语言原始 。 在数据流中, “ 前向” 构建一个基于“ 前向” 和“ 向” 后向” 程序, 和“ 后向” 的“ 向” 匹配”, 和“ 后向” 。 这个结果使得语言设计师能够将“ 向未来 方向 用于 未来 未来 的运行,,, 未来 将 将 将 进行 数据流 显示一个基于 的, 的, 以 直流 直流, 向后向,, 向 的 向 向,,, 直流 向,,,, 向 向 向 向 向 向, 向, 向 向 向 向,, 向 向 向 向 向 向 向, 向 向 向 向 向,,,,, 向,,,,,,,,,,,,,,,,,,,,, 向 向,,,,, 向 向,,,,,, 向 向, 向,, 向,,,, 从 向 向,,,

0
下载
关闭预览

相关内容

【经典书】模式识别导论,561页pdf
专知会员服务
79+阅读 · 2021年6月30日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
241+阅读 · 2020年4月19日
机器学习入门的经验与建议
专知会员服务
91+阅读 · 2019年10月10日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
RL 真经
CreateAMind
5+阅读 · 2018年12月28日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机类 | LICS 2019等国际会议信息7条
Call4Papers
3+阅读 · 2018年12月17日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Arxiv
64+阅读 · 2021年6月18日
Arxiv
13+阅读 · 2021年5月25日
Recent advances in deep learning theory
Arxiv
50+阅读 · 2020年12月20日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
逆强化学习-学习人先验的动机
CreateAMind
15+阅读 · 2019年1月18日
强化学习的Unsupervised Meta-Learning
CreateAMind
17+阅读 · 2019年1月7日
RL 真经
CreateAMind
5+阅读 · 2018年12月28日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机类 | LICS 2019等国际会议信息7条
Call4Papers
3+阅读 · 2018年12月17日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员