sub x y = Eval (runEval x - runEval y)
\end{lstHaskell}
-\section{Other embedding techniques}\label{sec:other}
-\section{Comparison}\label{sec:compare_embedding}
-Both flavours have their strengths and weaknesses.
-As we have seen with \glspl{GADT} for deep embedding and tagless-final for shallow embedding, both flavours can be improved in some way in order to mitigate (some of the) downsides.
-Besides deep and shallow embedding, there are some more advanced variants that try to mitigate some of the problems.
-
-\begin{table}[ht]
- \begin{threeparttable}[b]
- \caption{Comparison of embedding techniques, adapted from \citet[\citesection{3.6}]{sun_compositional_2022}}%
- \label{tbl:dsl_comparison}
- \begin{tabular}{lllllll}
- \toprule
- & Shallow & Deep & Hybrid & Poly & Comp. & Classy\\
- \midrule
- Transcoding free & yes & yes & no & yes & yes & yes\\
- Linguistic reuse & yes & no & partly\tnote{1} & yes & yes & no?\\
- Extend constructs & yes & no & partly\tnote{1} & yes & yes & yes\\
- Extend interpretations & no & yes & yes & yes & yes & yes\\
- Transformations & no & yes & yes & maybe\tnote{2} & maybe\tnote{2} & yes\\
- Modular dependencies & no & maybe & maybe & yes & yes & yes\\
- Nested pattern matching & no & yes & yes & no & maybe & maybe\tnote{3}\\
- Type safe & yes & maybe & no & yes & yes & yes\\
- \bottomrule
- \end{tabular}
- \begin{tablenotes}
- \item [1] Only in the shallowly embedded part.
- \item [2] Transformations require some ingenuity and are sometimes awkward to write.
- \item [3] It requires some---safe---form of dynamic typing.
- \end{tablenotes}
- \end{threeparttable}
-\end{table}
-
\input{subfilepostamble}
\end{document}