Constructed product result analysis for Haskell

Constructed product result analysis for Haskell
复制标题

Haskell 构建的产品结果分析

DOI:
10.1017/s0956796803004751
复制
发表时间:
2004
影响因子:
1.1
通讯作者:
S. Jones
S. Jones
中科院分区:
计算机科学2区
文献类型:
--
作者:
C. Baker;Kevin Glynn;S. Jones

文献摘要

被引文献

相似文献

ML和Haskell的编译器通常会遇到很多麻烦,以安排多个参数可以有效地传递给过程。出于某种原因,在确保多个结果也可以有效返回方面投入的精力似乎较少。在惰性函数式语言Haskell的上下文中,我们描述了一种分析,构造产品结果(CPR)分析,它确定函数何时可以在寄存器中返回多个结果。分析只基于函数的定义,而不是它的使用(因此很容易支持单独的编译),分析的结果可以通过函数定义的转换来表达。我们讨论了各种设计问题,在我们的实现中得到解决,并给出了我们的方法的有效性在一个实质性的基准集的测量。总的来说,性价比很好:好处一般来说是适度的(尽管偶尔会很大),但复杂性和编译时间的成本都很低。
Compilers for ML and Haskell typically go to a good deal of trouble to arrange that multiple arguments can be passed efficiently to a procedure. For some reason, less effort seems to be invested in ensuring that multiple results can also be returned efficiently. In the context of the lazy functional language Haskell, we describe an analysis, Constructed Product Result (CPR) analysis, that determines when a function can profitably return multiple results in registers. The analysis is based only on a function's definition, and not on its uses (so separate compilation is easily supported) and the results of the analysis can be expressed by a transformation of the function definition alone. We discuss a variety of design issues that were addressed in our implementation, and give measurements of the effectiveness of our approach across a substantial benchmark set. Overall, the price/performance ratio is good: the benefits are modest in general (though occasionally dramatic), but the costs in both complexity and compile time, are low.