当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
On the Performance of Bytecode Interpreters in Prolog
arXiv - CS - Programming Languages Pub Date : 2020-08-28 , DOI: arxiv-2008.12543
Philipp K\"orner, David Schneider, Michael Leuschel

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.

中文翻译:

关于 Prolog 中字节码解释器的性能

Prolog 的语义和递归执行模型使得以 AST(抽象语法树)解释器的形式表达语言解释器变得非常自然,其中执行遵循程序的树表示。另一种实现技术是字节码解释器。这些解释器在评估之前将程序转换为紧凑的线性表示,并且通常被认为更快并更好地利用资源。在本文中,我们讨论了在 Prolog 中表达解释器控制流的不同方式,并介绍了 AST 和字节码解释器的几种实现。在为此目的而设计的简单语言上,我们评估了命令式语言中最著名的技术是否适用于 Prolog 以及它们的性能如何。我们的最终目标是评估 Prolog 中哪种解释器设计最有效,因为我们打算将这些结果应用于更复杂的语言。但是,我们认为本文中的分析具有更广泛的意义。
更新日期:2020-08-31
down
wechat
bug