Why It's Nice to be Quoted: Quasiquoting for Prolog
Jan Wielemaker, Michael Hendricks

TL;DR
This paper adapts Haskell's quasiquoting mechanism to Prolog, enhancing its ability to embed external language snippets and handle long text fragments effectively, thus improving domain-specific language development and meta programming.
Contribution
The paper introduces a novel implementation of quasiquoting in Prolog, addressing its limitations in embedding external languages and managing long text fragments.
Findings
Quasiquoting in Prolog enables seamless embedding of external language snippets.
The implementation improves Prolog's support for domain-specific languages.
The approach is clean and effectively solves previous quoting limitations.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Logic, Reasoning, and Knowledge · Semantic Web and Ontologies
