Home
Schedule
Abstract Template
Masters Attendance
Center
Home
Courses
People
Projects
Page
Edit Page
Rename Page
Attach File
Printable
Wiki Source
More ...
Web
Recent Changes
Notify Service
News
Page Index
Search
More ...
Wiki
About TWiki
Text Formatting
Registration
Change Password
Reset Password
Users
Groups
Log In
or
Register
Typed Quote Antiquote
Stc
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 [1] and Okasaki [2] 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: [1] 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]]) [2] 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]])
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
gz
quote.tar.gz
manage
4.4 K
09 Feb 2006 - 10:04
GerritVanDenGeest
Haskell code of the running example
pdf
stc-slides.pdf
manage
265.5 K
09 Feb 2006 - 20:11
GerritVanDenGeest
Slides of this presentation