论文标题

关于prolog中字节码口译员的性能

On the Performance of Bytecode Interpreters in Prolog

论文作者

Körner, Philipp, Schneider, David, Leuschel, Michael

论文摘要

Prolog的语义和递归执行模型使以AST(抽象语法树)口译器的形式表达语言解释器非常自然,在此,执行遵循程序的树表示。另一种实现技术是字节码解释器。这些解释者在评估它之前将程序转换为紧凑和线性表示,通常被认为更快并更好地利用资源。 在本文中,我们讨论了表达prolog中解释者控制流程的不同方法,并介绍了AST和字节码解释者的几种实现。在为此目的设计的简单语言上,我们评估了从命令式语言中最知道的技术是否适用于Prolog以及它们的性能。我们的最终目标是评估Prolog中哪种口译设计是最有效的,因为我们打算将这些结果应用于更复杂的语言。但是,我们认为本文中的分析具有更普遍的兴趣。

The semantics and the recursive execution model of Prolog make it very natural to express language interpreters in form of AST (Abstract Syntax Tree) interpreters where the execution follows the tree representation of a program. An alternative implementation technique is that of bytecode interpreters. These interpreters transform the program into a compact and linear representation before evaluating it and are generally considered to be faster and to make better use of resources. In this paper, we discuss different ways to express the control flow of interpreters in Prolog and present several implementations of AST and bytecode interpreters. On a simple language designed for this purpose, we evaluate whether techniques best known from imperative languages are applicable in Prolog and how well they perform. Our ultimate goal is to assess which interpreter design in Prolog is the most efficient, as we intend to apply these results to a more complex language. However, we believe the analysis in this paper to be of more general interest.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源