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

用于调试的函数式程序评估可视化

Visualizing the Evaluation of Functional Programs for Debugging

John Whitington, Tom Ridge

AI总结:

本文提出一种函数式程序可视化原型,通过解释抽象语法树与美化打印为OCaml生成求值可视化,探讨空间限制、非纯特性等挑战,旨在服务程序调试。

摘要:

在这篇立场论文中,我们提出了一个函数式程序可视化工具的原型。这类程序的求值模型是通过重复应用重写规则将表达式归约为值,且通常很少或完全不使用可变状态,因此它们适合采用每个学童都熟悉的简单数学表达式的同类方式进行可视化。我们展示了如何通过直接解释抽象语法树并辅以适当的美化打印,为严格函数式语言OCaml生成此类可视化效果。我们描述了(并开始着手解决)在有限空间内呈现此类程序轨迹、识别其核心要素的挑战,以便我们的方法有朝一日能不再局限于玩具程序,具备实用性。我们还考量了现代函数式编程中非纯函数式部分带来的问题,比如可变状态、输入/输出以及异常。我们介绍了利用此类可视化效果解决程序调试问题的初步工作,这也是我们的最终目标。

英文摘要:

In this position paper, we present a prototype of a visualizer for functional programs. Such programs, whose evaluation model is the reduction of an expression to a value through repeated application of rewriting rules, and which tend to make little or no use of mutable state, are amenable to visualization in the same fashion as simple mathematical expressions, with which every schoolchild is familiar. We show how such visualizations may be produced for the strict functional language OCaml, by direct interpretation of the abstract syntax tree and appropriate pretty-printing. We describe (and begin to address) the challenges of presenting such program traces in limited space and of identifying their essential elements, so that our methods will one day be practical for more than toy programs. We consider the problems posed by the parts of modern functional programming which are not purely functional such as mutable state, input/output and exceptions. We describe initial work on the use of such visualizations to address the problem of program debugging, which is our ultimate aim.

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

↑