+Appendix~\ref{app:device-interface} shows the concrete interface for the
+devices.
+
+Text written using the \CI{Teletype} font indicates code and is often
+referring to a listing. \emph{Emphasized} text is used for proper nouns and
+words that have a unexpected meaning.
+
+\section{Related work}
+Several types of similar research have been conducted concerning these matters.
+Microcontrollers such as the \gls{Arduino} can be remotely controlled by the
+\gls{Firmata}-protocol\footnote{``firmata/protocol: Documentation of the
+Firmata protocol.'' (\url{https://github.com/firmata/protocol}). [Accessed:
+23-May-2017].}. This protocol
+is designed to expose the peripherals such as sensors to the server. This
+allows very fine grained control but with the cost of excessive communication
+overhead since no code is executed on the device, only the peripherals are
+queried. A \gls{Haskell} implementation of the protocol has been created%
+\footnote{``hArduino by LeventErkok.'' (\url{%
+https://leventerkok.github.io/hArduino}). [Accessed: 23-May-2017].}.
+
+\Gls{Clean} has a history of interpretation and there is a lot of research
+happening on the intermediate language \gls{SAPL}. \Gls{SAPL} is a purely
+functional intermediate language that has interpreters written in
+\gls{C++}~\cite{jansen_efficient_2007} and \gls{Javascript}%
+~\cite{domoszlai_implementing_2011} and \gls{Clean} and \gls{Haskell} compiler
+backends~\cite{domoszlai_compiling_2012}. However, interpreting the resulting
+code is still heap-heavy and therefore not directly suitable for devices with as
+little as $2K$ of RAM such as the \gls{Arduino} \emph{UNO}. It might be
+possible to compile the \gls{SAPL} code into efficient machine language or
+\gls{C} but then the system would lose its dynamic properties since the
+microcontroller then would have to be reprogrammed every time a new \gls{Task}
+is sent to the device.
+
+\Glspl{EDSL} have often been used to generate \gls{C} code for microcontroller
+environments. For starters, this work is built upon the \gls{mTask}-\gls{EDSL}
+that generates \gls{C} code to run a \gls{TOP}-like system on microcontrollers%
+~\cite{plasmeijer_shallow_2016}~\cite{koopman_type-safe_nodate}.
+Again, this requires a reprogramming cycle every time the
+\gls{Task}-specification is changed.
+
+Another \gls{EDSL} designed to generate low-level high-assurance programs is
+called \gls{Ivory} and uses \gls{Haskell} as a host language%
+~\cite{elliott_guilt_2015}. The language uses the \gls{Haskell} type-system to
+make unsafe languages type safe. For example, \gls{Ivory} has been used in the
+automotive industry to program parts of an autopilot%
+~\cite{pike_programming_2014}~\cite{hickey_building_2014}. \Gls{Ivory}'s syntax
+is deeply embedded but the type system is shallowly embedded. This requires
+several \gls{Haskell} extensions that offer dependent type constructions. The
+process of compiling an \gls{Ivory} program happens in stages. The embedded
+code is transformed into an \gls{AST} that is sent to a backend. The
+\gls{mTask} \gls{EDSL} transforms the embedded code during compile-time
+directly into the backend which is often a state transformer that will execute
+on runtime.