arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1108.4706cs.PL
收藏

步进懒惰程序

Stepping Lazy Programs

Stephen Chang, John Clements, Eli Barzilay, Matthias Felleisen

摘要:

消除懒惰的函数式程序带来了严重的挑战。为了支持命令式语言的“停止、检查和恢复”调试风格,一些调试工具放弃了惰性计算。其他调试器保留了惰性,但以一种可能使程序员感到困惑的方式呈现,因为评估的焦点以一种看似随机的方式跳跃。在本文中,我们介绍了一个补充工具,代数程序步进。代数步进器将计算显示为数学计算。代数单步执行对于初学者或刚接触惰性编程的程序员特别有用。从数学上讲,代数步进器将计算呈现为懒惰微积分的标准重写序列。我们的新的懒惰语义介绍了懒惰的评价作为一种形式的并行程序重写。它代表了Launchbury的基于存储的语义和通过参数共享的懒惰计算的简单公理化描述之间的折衷。最后,我们证明了步进的运行时机器正确地重建标准的重写序列。

英文摘要:

Debugging lazy functional programs poses serious challenges. In support of the "stop, examine, and resume" debugging style of imperative languages, some debugging tools abandon lazy evaluation. Other debuggers preserve laziness but present it in a way that may confuse programmers because the focus of evaluation jumps around in a seemingly random manner. In this paper, we introduce a supplemental tool, the algebraic program stepper. An algebraic stepper shows computation as a mathematical calculation. Algebraic stepping could be particularly useful for novice programmers or programmers new to lazy programming. Mathematically speaking, an algebraic stepper renders computation as the standard rewriting sequence of a lazy lambda-calculus. Our novel lazy semantics introduces lazy evaluation as a form of parallel program rewriting. It represents a compromise between Launchbury's store-based semantics and a simple, axiomatic description of lazy computation as sharing-via-parameters. Finally, we prove that the stepper's run-time machinery correctly reconstructs the standard rewriting sequence.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑