Add section on EDSLs.
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 4 Dec 2009 21:56:15 +0000 (22:56 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Fri, 4 Dec 2009 21:56:15 +0000 (22:56 +0100)
Chapters/Context.tex
Utils/Lambda.tex

index 9213c5515994ba0cc97e25b8d5f7854c6bcbae97..3c09d95316e5c9aacd4479be0af9cbc9a77a01c8 100644 (file)
@@ -20,8 +20,6 @@
   language (you can't use case statements in Lava, since they would be
   executed only once during circuit generation) and extra notational overhead.
 
   language (you can't use case statements in Lava, since they would be
   executed only once during circuit generation) and extra notational overhead.
 
-\fxnote{There should be a section on DSLs here}
-
   We will now have a look at the existing hardware description languages,
   both conventional and functional to see the fields in which Cλash is
   operating.
   We will now have a look at the existing hardware description languages,
   both conventional and functional to see the fields in which Cλash is
   operating.
       simplify program verification.
     \stopitemize
   
       simplify program verification.
     \stopitemize
   
-  \section{Existing functional hardware description languages}
+    \placeintermezzo{}{
+      \defref{EDSL}
+      \startframedtext[width=8.5cm,background=box,frame=no]
+      \startalignment[center]
+        {\tfa Embedded domain-specific languages (\small{EDSL})}
+      \stopalignment
+      \blank[medium]
+     
+      \startcitedquotation[hudak96]
+      A domain-specific language (\small{DSL}) is a program-
+      ming language or executable specification language
+      that offers, through appropriate notations and ab-
+      stractions, expressive power focused on, and usu-
+      ally restricted to, a particular problem domain.
+      \stopcitedquotation
+
+      \todo{ref: http://portal.acm.org/citation.cfm?id=352035\&dl=}
+      
+      An embedded \small{DSL} is a \small{DSL} that is embedded in
+      another language. Haskell is commonly used to embed \small{DSL}s
+      in, which typically means a number of Haskell functions and types
+      are made available that can be called to construct a large value
+      of some domain-specific datatype (\eg, a circuit datatype). This
+      generated datatype can then be processed further by the
+      \small{EDSL} \quote{compiler} (which runs in the same environment
+      as the \small{EDSL} itself. The embedded language is then a, mostly
+      applicative, subset of Haskell where the library functions are the
+      primitives. Sometimes advanced haskell features such as
+      polymorphism, higher order values or type classes can be used in
+      the embedded language.
+      \stopframedtext
+    }
+
+  \section[sec:context:fhdls]{Existing functional hardware description languages}
     As noted above, we're not the first to walk this path. However, current
     embedded functional hardware description languages (in particular those
     using Haskell) are limited by:\todo{Separate TH and EDSL approaches
     As noted above, we're not the first to walk this path. However, current
     embedded functional hardware description languages (in particular those
     using Haskell) are limited by:\todo{Separate TH and EDSL approaches
index 319b4249697ca79ab4ebad3f806f44f4be00bf05..f88dfb435c3134b24ae0f94a47c846ebdfbdfc80 100644 (file)
@@ -138,4 +138,17 @@ draw b;
 \setupcaption[intermezzo][location=top,number=no] % Put captions on top
 
 \setupheads[aligntitle=float]
 \setupcaption[intermezzo][location=top,number=no] % Put captions on top
 
 \setupheads[aligntitle=float]
+
+% A variant of \startquotation that puts a citation directly after the
+% quote.
+\long\def\startcitedquotation[#1]#2\stopcitedquotation
+    {\bgroup \par
+     \startnarrower
+       \symbol[leftquotation]%
+       #2\removeunwantedspaces
+       \symbol[rightquotation]%
+       \mbox{ }\cite[#1]
+     \stopnarrower
+     \par \egroup}
+
 % vim: set sw=2 sts=2 expandtab:
 % vim: set sw=2 sts=2 expandtab: