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

无撕裂的编译器类型修改:类型化分隔控制运算符的传递式翻译

Answer-Type Modification without Tears: Prompt-Passing Style Translation for Typed Delimited-Control Operators

Ikuo Kobori, Yukiyoshi Kameyama, Oleg Kiselyov

摘要:

定界控制运算符的显著特征是它们能够在计算过程中修改答案类型。Answer-type modification(简称ATM)的特性允许人们很好地表达各种有趣的程序,如类型化的printf,但它很难将这些运算符嵌入标准函数语言中。在本文中,我们提出了一个类型化的翻译定界控制操作符移位和重置与ATM到一个熟悉的语言与多提示移位和重置没有ATM,这让我们使用ATM标准语言,而无需修改类型系统。我们的翻译概括了Kiselyov的类型printf的直接风格实现,它使用两个提示来模拟答案类型的修改,并在计算过程中传递它们。我们证明,我们的翻译保留打字。由于朴素的传递样式翻译生成并传递许多提示,即使是纯术语,我们展示了一个优化的翻译,仅在需要时生成提示,这也是类型保留的。最后,我们给出了一个无标签的最终风格的实现,它尊重类型的建设。

英文摘要:

The salient feature of delimited-control operators is their ability to modify answer types during computation. The feature, answer-type modification (ATM for short), allows one to express various interesting programs such as typed printf compactly and nicely, while it makes it difficult to embed these operators in standard functional languages. In this paper, we present a typed translation of delimited-control operators shift and reset with ATM into a familiar language with multi-prompt shift and reset without ATM, which lets us use ATM in standard languages without modifying the type system. Our translation generalizes Kiselyov's direct-style implementation of typed printf, which uses two prompts to emulate the modification of answer types, and passes them during computation. We prove that our translation preserves typing. As the naive prompt-passing style translation generates and passes many prompts even for pure terms, we show an optimized translation that generate prompts only when needed, which is also type-preserving. Finally, we give an implementation in the tagless-final style which respects typing by construction.

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

↑