X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=methods.dsl.tex;h=0ee9a243c681b908cb2fa534b2171e9e3825861f;hb=d118ff9d857683084065145df45135ef6fa06711;hp=9b8bf48cb77fe5fbe594b5367fa22a02a3b1aedb;hpb=d6597e0f75fe3f156ca05fcc0903fd9f60a64396;p=msc-thesis1617.git diff --git a/methods.dsl.tex b/methods.dsl.tex index 9b8bf48..0ee9a24 100644 --- a/methods.dsl.tex +++ b/methods.dsl.tex @@ -1,10 +1,9 @@ -\section{\acrlong{EDSL}s} There are several techniques available for creating \glspl{EDSL}. Each of them have their own advantages and disadvantages such as extendability, typedness and view support. In the following subsections each of the main techniques are briefly explained. -\subsection{Deep embedding} +\section{Deep embedding} A deep \gls{EDSL} means that the language is represented as an \gls{ADT}. Views are functions that transform something to the datatype or the other way around. As an example we have the simple arithmetic \gls{EDSL} shown in @@ -50,7 +49,7 @@ compile time guarantee is given that all views support it. | E.e: Eq (DSL e) (DSL e) -> DSL Bool & == e \end{lstlisting} -\subsection{Shallow embedding} +\section{Shallow embedding} In a shallowly \gls{EDSL} all language constructs are expressed as functions in the host language. An evaluator view for our example language then looks something like the code shown in Listing~\ref{lst:exshallow}. Note that much of @@ -88,7 +87,7 @@ information for all the views. This will mean that every component will have to implement all views. This makes it slow for multiple views and complex to implement. -\subsection{Class based shallow embedding} +\section{Class based shallow embedding} The third type of embedding is called class based shallow embedding and has the best of both shallow and deep embedding. In class based shallow embedding the language constructs are defined as type classes. The same language is shown