arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1308.3941cs.PL
收藏

为什么被引用很好:Prolog的Quasiquoting

Why It's Nice to be Quoted: Quasiquoting for Prolog

Jan Wielemaker, Michael Hendricks

摘要:

Prolog对动态规划、Meta编程和使用上下文无关文法的文本处理的支持使得该语言非常适合于定义领域特定语言(DSL)以及分析、重构或生成其他(编程)语言中的表达式状态。众所周知的DSL是DCG(Definite Clause Grammar)表示法和约束语言,如CHR。这些扩展使用Prolog运算符声明和{...}符号来实现一个好的语法。当外部语言,如HTML、SQL或JavaScript进入画面时,操作符不再满足将这些语言的片段嵌入到Prolog源文件中。此外,Prolog对引用长文本片段的支持很差。Haskell引入了准引号来解决这个问题。在本文中,我们'移植'的Haskell机制,准引用的Prolog。我们表明,这是可以做到干净,准引用可以解决上述问题。

英文摘要:

Prolog's support for dynamic programming, meta programming and text processing using context free grammars make the language highly suitable for defining domain specific languages (DSL) as well as analysing, refactoring or generating expression states in other (programming) languages. Well known DSLs are the DCG (Definite Clause Grammar) notation and constraint languages such as CHR. These extensions use Prolog operator declarations and the {...} notation to realise a good syntax. When external languages, such as HTML, SQL or JavaScript enter the picture, operators no longer satisfy for embedding snippets of these languages into a Prolog source file. In addition, Prolog has poor support for quoting long text fragments. Haskell introduced quasi quotationsto resolve this problem. In this paper we `ported' the Haskell mechanism for quasi quoting to Prolog. We show that this can be done cleanly and that quasi quoting can solve the above mentioned problems.

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

↑