rename faulty files and elaborate in the system chapter
[msc-thesis1617.git] / mtask.tex
1 The \gls{mTask}-\gls{EDSL} was created by Koopman et al.\ and supports several
2 views such as an \gls{iTasks} simulation and a \gls{C}-code generator. The
3 \gls{EDSL} was designed to generate a ready-to-compile \gls{TOP}-like program
4 for microcontrollers such as the \gls{Arduino}~\cite{koopman_type-safe_nodate}%
5 \cite{plasmeijer_shallow_2016}.
6
7 The \gls{mTask}-\gls{EDSL} is a shallowly embedded class based \gls{EDSL} and
8 therefore it is very suitable to have a new backend that partly implements the
9 classes given. The following sections show the details of the \gls{EDSL} that
10 is used in this extension. The parts of the \gls{EDSL} that are not used will
11 not be discussed and the details of those parts can be found in the cited
12 literature.
13
14 A view for the \gls{mTask}-\gls{EDSL} is a type with two free type
15 variables\footnote{kind \CI{*->*->*}.} that implements some of the classes
16 given. The types do not have to be present as fields in the view and can, and
17 will most often, be exclusively phantom types. Thus, views are of the
18 form:\\\CI{:: v t r = ...}. The first type variable will be the type of the
19 view. The second type variable will be the type of the \gls{EDSL}-expression
20 and the third type variable represents the role of the expression. Currently
21 the role of the expressions form a hierarchy. The three roles and their
22 hierarchy are shown in Listing~\ref{lst:exprhier}. This implies that everything
23 is a statement, only an \CI{Upd} and an \CI{Expr} are expressions. The \CI{Upd}
24 restriction describes updatable expressions such as \gls{GPIO} pins and
25 \glspl{SDS}.
26
27 \begin{lstlisting}[%
28 label={lst:exprhier},caption={Expression role hierarchy}]
29 :: Upd = Upd
30 :: Expr = Expr
31 :: Stmt = Stmt
32
33 class isExpr a :: a -> Int
34 instance isExpr Upd
35 instance isExpr Expr
36 \end{lstlisting}
37
38 \section{Expressions}
39 \input{mtask.expr}
40
41 \section{Control flow}
42 \input{mtask.control}
43
44 \section{Input/Output and class extensions}
45 \input{mtask.io}
46
47 \section{Semantics}
48 \input{mtask.semantics}
49
50 \section{Example mTask}
51 \input{mtask.examples}