update presentation more
[msc-thesis1617.git] / intro.related.tex
1 Similar research has been conducted on the subject.
2 For example, microcontrollers such as the \gls{Arduino} can be remotely
3 controlled by the \gls{Firmata}-protocol\footnote{``firmata/protocol:
4 Documentation of the Firmata protocol.''
5 (\url{https://github.com/firmata/protocol}). [Accessed: 23-May-2017].}. This
6 protocol is designed to expose the peripherals such as sensors to the server.
7 This allows very fine grained control but with the cost of excessive
8 communication overhead since no code is executed on the device, only the
9 peripherals are queried. A \gls{Haskell} implementation of the protocol is
10 also available\footnote{``hArduino by LeventErkok.'' (\url{%
11 https://leventerkok.github.io/hArduino}). [Accessed: 23-May-2017].}.
12
13 \Gls{Clean} has a history of interpretation and there is a lot of research
14 happening on the intermediate language \gls{SAPL}. \Gls{SAPL} is a purely
15 functional intermediate language that has interpreters written in
16 \gls{C++}~\cite{jansen_efficient_2007}, \gls{Javascript}%
17 ~\cite{domoszlai_implementing_2011} and \gls{Clean} and \gls{Haskell} compiler
18 backends~\cite{domoszlai_compiling_2012}. However, interpreting the resulting
19 code is still heap-heavy and therefore not directly suitable for devices with
20 as little as $2K$ of RAM such as the \gls{Arduino} \emph{Uno}. It might be
21 possible to compile the \gls{SAPL} code into efficient machine language or
22 \gls{C} but then the system would lose its dynamic properties since the
23 microcontroller then would have to be reprogrammed every time a new \gls{Task}
24 is sent to the device.
25
26 \Glspl{EDSL} have often been used to generate \gls{C} code for microcontroller
27 environments. This work uses parts of the existing \gls{mTask}-\gls{EDSL} which
28 generates \gls{C} code to run a \gls{TOP}-like system on microcontrollers%
29 ~\cite{plasmeijer_shallow_2016}~\cite{koopman_type-safe_nodate}. Again, this
30 requires a reprogramming cycle every time the \gls{Task}-specification is
31 changed.
32
33 Another \gls{EDSL} designed to generate low-level high-assurance programs is
34 called \gls{Ivory} and uses \gls{Haskell} as a host language%
35 ~\cite{elliott_guilt_2015}. The language uses the \gls{Haskell} type-system to
36 make unsafe languages type safe. For example, \gls{Ivory} has been used in the
37 automotive industry to program parts of an autopilot%
38 ~\cite{pike_programming_2014}~\cite{hickey_building_2014}. \Gls{Ivory}'s syntax
39 is deeply embedded but the type system is shallowly embedded. This requires
40 several \gls{Haskell} extensions that offer dependent type constructions. The
41 process of compiling an \gls{Ivory} program happens in stages. The embedded
42 code is transformed into an \gls{AST} that is sent to a backend. In the new
43 system, the \gls{mTask}-\gls{EDSL} transforms the embedded code during
44 compile-time directly into the backend which is often a state transformer that
45 will execute on runtime.