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

通过解释器调试函数式程序

Debugging Functional Programs by Interpretation

John Whitington

AI总结:

该研究针对函数式编程环境下调试器未被广泛使用的问题,定义了可用调试器的特征,提出了由独立解释型调试器和语法扩展组成的OCaml新型调试器,可实现源码级调试,有望被广泛采用。

摘要:

受编程实践与编程教学经验的启发,我们针对调试这一长期存在的问题展开了新的探索。在探究了调试器(尤其是函数式编程环境下的调试器)未如预期般被广泛使用的原因后,我们定义了调试器具备可用性、进而有望被广泛采用的核心特征。我们提出了一款面向函数式编程语言OCaml的新型调试器,它通过直接解释程序源代码运行,支持打印程序求值的各个步骤,本文还讨论了该调试器的技术实现与实际应用。\n该调试器由两部分组成:一是独立调试器,可通过解释方式运行OCaml程序,从而支持检查程序的运行行为;二是OCaml语法扩展,可使被审查的程序部分以与独立调试器相同的方式被解释执行,而程序的其余部分则以原生方式运行。我们展示了后一种机制如何构建出具备可用调试器特征的源码级调试系统,因此该系统最终有望适合广泛推广使用。

英文摘要:

Motivated by experience in programming and in the teaching of programming, we make another assault on the longstanding problem of debugging. Having explored why debuggers are not used as widely as one might expect, especially in functional programming environments, we define the characteristics of a debugger which make it usable and thus likely to be widely used. We present work on a new debugger for the functional programming language OCaml which operates by direct interpretation of the program source, allowing the printing out of individual steps of the program's evaluation, and discuss its technical implementation and practical use. It has two parts: a stand-alone debugger which can run OCaml programs by interpretation and so allow their behaviour to be inspected; and an OCaml syntax extension, which allows the part of a program under scrutiny to be interpreted in the same fashion as the stand-alone debugger whilst the rest of the program runs natively. We show how this latter mechanism can create a source-level debugging system that has the characteristics of a usable debugger and so may eventually be expected to be suitable for widespread adoption.

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

↑