Add some references to the context chapter.
[matthijs/master-project/report.git] / Chapters / Context.tex
index 9213c5515994ba0cc97e25b8d5f7854c6bcbae97..1b0268922932952500644424fb3916268881fef6 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.
 
-\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.
@@ -36,7 +34,6 @@
       and ability to abstract away  common patterns.  This is largely enabled
       by features like an advanced type system with polymorphism and higher
       order functions.
-      \todo{Does this apply to FHDLs equally?}
       \item Type-safer. Functional programs typically have a highly expressive
       type system, which makes it harder to write incorrect code.
       \item Easy to process. Functional languages have nice properties like
       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[deursen00]
+      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
+
+      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. \cite[hudak96]
+      \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
@@ -58,8 +86,7 @@
       variables (\eg, using the same variable twice while only calculating it
       once) and cycles in circuits are non-trivial to properly and safely
       translate (though there is some work to fix this, but that has not been
-      possible in a completely reliable way yet.  \todo{ref
-      http://www.ittc.ku.edu/~andygill/paper.php?label=DSLExtract09}
+      possible in a completely reliable way yet. \cite[gill09]
       \item Some things are verbose to express. Especially ForSyDe suffers
       from a lot of notational overhead due to the Template Haskell approach
       used. Since conditional statements are not supported, a lot of Haskell's