连续传递风格、去功能化、累积和关联性
Continuation-Passing Style, Defunctionalization, Accumulations, and Associativity
摘要:
内容:Reynolds向我们展示了如何使用continuation-passing风格和去功能化将一种语言的递归解释器转换为该语言程序的抽象机器。同样的技术解释了其他编程技巧,包括拉链和累积参数。探究:在所有这些应用中,通常隐藏着对结合性的代数性质的吸引力。方法:我们在本文中的目的是吸引关联性走出阴影,进入聚光灯下。知识:我们回顾了一些著名的应用程序(阶乘,快速反向,树扁平化,和一个简单的表达式语言的编译器),以突出他们对结合性的依赖。接地:我们重播这些程序的发展,通过一系列的程序转换和数据的改进,证明了方程推理。重要性:理解结合性所起的关键作用可以澄清什么时候延续传递风格和去功能化可以帮助,什么时候不能,并可能促进这些技术的其他应用。
英文摘要:
Context: Reynolds showed us how to use continuation-passing style and defunctionalization to transform a recursive interpreter for a language into an abstract machine for programs in that language. The same techniques explain other programming tricks, including zippers and accumulating parameters. Inquiry: Buried within all those applications there is usually a hidden appeal to the algebraic property of associativity. Approach: Our purpose in this paper is to entice associativity out of the shadows and into the limelight. Knowledge: We revisit some well-known applications (factorial, fast reverse, tree flattening, and a compiler for a simple expression language) to spotlight their dependence on associativity. Grounding: We replay developments of these programs through a series of program transformations and data refinements, justified by equational reasoning. Importance: Understanding the crucial role played by associativity clarifies when continuation-passing style and defunctionalization can help and when they cannot, and may prompt other applications of these techniques.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。