You are here:
(02 Sep 2010,
Date: 2006-02-09 Time: 11:45 Room: BBL room 471 ----+++ Speaker: Gerrit van den Geest ----+++ Title: Typed Quote/Antiquote ----+++ Abstract We present work of Hinze  and Okasaki  about a systematic approach to embed languages in Haskell with a quote/antiquote mechanism. A quote/antiquote mechanism makes it possible to use the concrete syntax of a specific language inside a host language by enclosing it in quotes. Inside the quotation one can escape to the host language by using an antiquotation. This technique can be used to embed Domain Specific Languages (DSLs) in Haskell. Domain Specific Languages have many benefits, like programs that are easier to understand and reason about. But the additional start-up costs of implementing a lexer, parser, compiler, and pretty-printer for a DSL, are often to high. We can lower those costs by embedding a DSL inside another language, this is called a Domain Specific Embedded Language (DSEL). During the presentation we introduce an increasingly complex syntax for a combinator library expressing Financial Contracts (Peyton-Jones et al.). We start with postfix notation, prefix notation, and a grammar in Greibach Normal Form (GNF) for this DSEL. Then we proceed by implementing a syntax given by a LL(1), and a LR(0) grammar. We show how to translate those grammars to an implementation in Haskell. To accomplish this, we use: overloading, polymorphism and, higher order functions. Also techniques reminiscent of the continuation monad are used. Presentation code and slides: * [[%ATTACHURL%/quote.tar.gz][quote.tar.gz]]: Haskell code of the running example * [[%ATTACHURL%/stc-slides.pdf][stc-slides.pdf]]: Slides of this presentation References:  Ralf Hinze. Functional Pearl: Typed Quote/Antiquote. Under consideration for publication in J. Functional Programming. ([[http://www.informatik.uni-bonn.de/~ralf/publications/Quote.pdf][pdf]])  Chris Okasaki. Techniques for embedding postfix languages in Haskell. Haskell '02: Proceedings of the 2002 ACM SIGPLAN workshop on Haskell. ([[http://portal.acm.org/ft_gateway.cfm?id=581699&type=pdf][pdf]])
09 Feb 2006 - 10:04
Haskell code of the running example
09 Feb 2006 - 20:11
Slides of this presentation
ore topic actions
Topic revision: r12 - 02 Sep 2010,
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding UUCS?