Hostname: page-component-8448b6f56d-wq2xx Total loading time: 0 Render date: 2024-04-24T00:21:58.653Z Has data issue: false hasContentIssue false

Typed quote/antiquote or: Compile-time parsing

Published online by Cambridge University Press:  27 May 2011

RALF HINZE*
Affiliation:
Department of Computer Science, University of Oxford, Wolfson Building, Parks Road, Oxford OX1 3QD, England, UK (e-mail: ralf.hinze@cs.ox.ac.uk)
Rights & Permissions [Opens in a new window]

Extract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Haskell (Peyton Jones, 2003) is often used as a host language for embedding other languages. Typically, the abstract syntax of the guest language is defined by a collection of datatype declarations; parsers and pretty-printers convert between the concrete syntax and its abstract representation. A quote/antiquote mechanism permits a tighter integration of the guest language into the host language by allowing one to use phrases in the guest language's concrete syntax.

Type
Functional Pearl
Copyright
Copyright © Cambridge University Press 2011

References

Aho, A. V., Lam, M. S., Sethi, R. & Ullman, J. D. (2006) Compilers: Principles, Techniques, and Tools. 2nd ed.Addison-Wesley.Google Scholar
Okasaki, C. (2002) Techniques for embedding postfix languages in Haskell. In Proceedings of the 2002 ACM SIGPLAN Haskell Workshop, Chakravarty, M. (ed), ACM, pp. 105113.CrossRefGoogle Scholar
Okasaki, C. (2003) Theoretical Pearls: Flattening combinators: Surviving without parentheses. J. Funct. Program., 13 (4), 815822.CrossRefGoogle Scholar
Peyton Jones, S. (2003) Haskell 98 Language and Libraries. Cambridge University Press.Google Scholar
Wadler, P. (1989) Theorems for free! In the Fourth International Conference on Functional Programming Languages and Computer Architecture (FPCA'89). London, UK: Addison-Wesley, pp. 347359.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.