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

规范化嵌入

Embedding by Normalisation

Shayan Najd, Sam Lindley, Josef Svenningsson, Philip Wadler

摘要:

本文提出的见解,实用的嵌入技术,通常用于实现特定领域的语言,对应于理论的规范化评估(NBE)技术,通常用于推导规范形式的条款相对于方程理论。NBE由四个部分组成:一个句法域,一个语义域,和一对在两者之间的翻译。嵌入通常由四个部分组成:目标语言,宿主语言,在宿主中编码目标术语,以及从宿主中提取目标代码。这种对应关系是深刻的,因为嵌入和NBE中的所有四个组件都相互对应。基于这种对应关系,本文介绍了嵌入规范化(EBN)作为一种原则性的方法来研究和结构嵌入。对应关系是有用的,从NBE的解决方案可以借用,以解决问题的嵌入。特别是,基于NBE技术,如类型导向部分求值,本文提出了一种解决方案,从嵌入式程序中提取目标代码涉及和类型,如条件表达式,和原语,如文字和操作。

英文摘要:

This paper presents the insight that practical embedding techniques, commonly used for implementing Domain-Specific Languages, correspond to theoretical Normalisation-By-Evaluation (NBE) techniques, commonly used for deriving canonical form of terms with respect to an equational theory. NBE constitutes of four components: a syntactic domain, a semantic domain, and a pair of translations between the two. Embedding also often constitutes of four components: an object language, a host language, encoding of object terms in the host, and extraction of object code from the host. The correspondence is deep in that all four components in embedding and NBE correspond to each other. Based on this correspondence, this paper introduces Embedding-By-Normalisation (EBN) as a principled approach to study and structure embedding. The correspondence is useful in that solutions from NBE can be borrowed to solve problems in embedding. In particular, based on NBE techniques, such as Type-Directed Partial Evaluation, this paper presents a solution to the problem of extracting object code from embedded programs involving sum types, such as conditional expressions, and primitives, such as literals and operations on them.

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

↑