\section{Introduction}
\label{sec:introduction}
    \frame{\sectionpage}

    \subsection{Motivation}
    \label{subsec:motivation}
        \begin{frame}
            \frametitle{Hardware design}

            \par{Hardware design is \emph{very complex} \textbf{and} \emph{very expensive}:}
            \vspace{0.2cm}
            \begin{itemize}
                \item Mistakes discovered after sales are much more serious
                    \begin{itemize}
                        \item No such thing as an ``update'' to a chip
                    \end{itemize}
                \item Thus the need for extensive simulation
                    \begin{itemize}
                        \item Using specific and \emph{expensive} systems
                    \end{itemize}
                \item The downfall of \emph{Moore's Law} doesn't help either
                    \begin{itemize}
                        \item More need for parallelism, fault-tolerance, etc.
                        \item Design \emph{even more} \emph{error-prone} and validation \emph{even more} complex
                    \end{itemize}
            \end{itemize}

            \note{
                \begin{itemize}
                    \item Sometimes even \emph{exhaustive} simulation
                \end{itemize}
            }
        \end{frame}

        \begin{frame}
            \frametitle{Hardware design}

            \begin{itemize}
                \item The level of abstraction has been lifted already\ldots
                    \begin{itemize}
                        \item Verilog and VHDL in the 1980s
                        \item Popular, \emph{de facto} industry standards
                    \end{itemize}
                \vspace{0.3cm}
                \item \emph{Functional} hardware design languages, also since the 1980s
                    \begin{itemize}
                        \item Expressive type systems, equational reasoning, etc.
                        \item First, languages designed \emph{from scratch}
                        \item Then, \emph{embedded} in general-purpose functional languages
                            \begin{itemize}
                                \item Prominently, in Haskell
                                \item Several of them available nowadays
                                \item Each with its own strengths and weaknesses
                            \end{itemize}
                    \end{itemize}
            \end{itemize}

            \note{
                \begin{itemize}
                    \item Verilog in 1985, VHDL afterwards
                    \item Wouldn't it be nice to have developments from functional programming also?
                \end{itemize}
            }
        \end{frame}

        \begin{frame}
            \frametitle{Goals of this project}

            \par{Compare exisiting functional Embedded Domain-Specific Languages (EDSLs) for hardware description.}
            \vspace{0.2cm}
            \begin{itemize}
                \item A representative sample of EDSLs
                \item Analyze a well-defined set of \emph{criteria}
                \item Practical analysis, with a set of circuits as \emph{case studies}
            \end{itemize}

            \vspace{0.2cm}
            \par{Detect possible improvements as future work}

            \pause
            \vspace{0.4cm}
            \par{Let's first review our object of study}

            \note{
                \begin{itemize}
                    \item More details on the choice of EDSLs later
                    \item Also more details on the criteria and circuits
                \end{itemize}
            }
        \end{frame}


    \subsection{Hardware EDSLs}
    \label{subsec:hardware-edsls}
        % deep-embedded / shallow embedded
        \begin{frame}
            \frametitle{Domain-Specific Languages}

            \par{A computer language (turing-complete or \emph{not}) targeting a \emph{specific application domain.}}
            \par{\textbf{Example DSLs:}}
            \begin{itemize}
                \item SQL (database queries)
                \item CSS (document formatting)
                \item MATLAB (Matrix programming)
                \item VHDL (Hardware description)
            \end{itemize}

            \pause

            \vspace{0.3cm}
            \par{A DSL can also be \emph{embedded} in a general-purpose language.}
            \par{\textbf{Example EDSLs:}}
            \begin{itemize}
                \item Boost.Proto (C++ / parser combinators)
                \item Diagrams (Haskell / programmatic drawing)
                \item Parsec (Haskell / parser combinators)
            \end{itemize}

            \note{
                \begin{itemize}
                    \item Turing-complete DSLs not \emph{exclusive}, just \emph{targeted} (MatLab)
                    \item Parsec by Daan Leijen and Erik Meijer (UU), 2001
                \end{itemize}
            }
        \end{frame}


        \begin{frame}
            \frametitle{Example of an EDSL: \texttt{Parsec}}

            A simple parser for a "Game of Life"-like input format:
            \haskellfile{code/parsec-example.hs}

            \vspace{0.2cm}
            \begin{itemize}
                \item The shallow vs. deep-embedded divide
                    \begin{itemize}
                        \item Parsec is \emph{shallow}-embedded
                    \end{itemize}
            \end{itemize}

            \note{
                \begin{itemize}
                    \item YACC (parser \emph{generator}) would de a deep-``embedded'' DSL)
                    \item Diagrams also deep
                    \item deep EDSLs can have multiple \emph{interpretations}
                \end{itemize}
            }
        \end{frame}

        \begin{frame}
            \frametitle{Hardware EDSLs}
            An EDSL used for hardware design-related tasks. Can encompass:

            \begin{itemize}
                \item Modeling / description
                \item Simulation (validation)
                \item Formal verification
                \item Synthesis to other (lower-level) languages
            \end{itemize}

            \vspace{0.5cm}
            \par{Example of a hardware EDSL (Lava):}
            \vspace{0.2cm}
            \haskellfile{code/hardware-edsl-example.hs}
        \end{frame}

