arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1606.06380cs.PL
收藏

通过程序转换从Push/Enter到Eval/Apply

From Push/Enter to Eval/Apply by Program Transformation

Maciej Piróg, Jeremy Gibbons

摘要:

push/enter和eval/apply是函数式语言实现中使用的两种调用约定。在本文中,我们探讨了以下观察:当考虑具有多个参数的函数时,push/enter和eval/apply约定下的堆栈的行为类似于列表数据类型的两个特定实现:常规cons-list和具有惰性串联的列表形式。根据Danvy et al.的定义解释器和抽象机之间的功能对应关系,我们使用这个观察到的抽象机,实现推/进入到一个抽象机,实现eval/apply。我们表明,我们的方法是灵活的,足以将推/输入无脊椎无标记的G机(这是GHC Haskell编译器的语义核心)到其eval/apply变体。

英文摘要:

Push/enter and eval/apply are two calling conventions used in implementations of functional languages. In this paper, we explore the following observation: when considering functions with multiple arguments, the stack under the push/enter and eval/apply conventions behaves similarly to two particular implementations of the list datatype: the regular cons-list and a form of lists with lazy concatenation respectively. Along the lines of Danvy et al.'s functional correspondence between definitional interpreters and abstract machines, we use this observation to transform an abstract machine that implements push/enter into an abstract machine that implements eval/apply. We show that our method is flexible enough to transform the push/enter Spineless Tagless G-machine (which is the semantic core of the GHC Haskell compiler) into its eval/apply variant.

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

↑