elaborate on device storage and prepare device communication
[msc-thesis1617.git] / results.mtask.tex
1 Some functionality of the original \gls{mTask}-\gls{EDSL} will not be used in
2 this extension \gls{EDSL}. Conversely, some functionality needed was not
3 available in the existing \gls{EDSL}. Due to the nature of class based shallow
4 embedding this obstacle is very easy to solve. A type housing the \gls{EDSL}
5 does not have to implement all the available classes. Moreover, classes can be
6 added at will without interfering with the existing views.
7
8 \section{Bytecode compilation view}
9 The \glspl{mTask} are sent to the device in bytecode and are saved in the
10 memory of the device. To compile the \gls{EDSL} code to bytecode a \gls{RWST}
11 is used. The \gls{RWST} is a state transformer stacked on a \emph{Reader} monad
12 and a \emph{Writer} monad. In this case the transformer part is not used.
13 However, this can be done to add for example better runtime error handling.
14
15 \begin{lstlisting}[language=Clean]
16 :: ByteCode a p = BC (RWS () [BC] BCState ())
17 :: BCValue = E.e: BCValue e & mTaskType, TC e
18 :: BCShare = {
19 sdsi :: Int,
20 sdsval :: BCValue
21 }
22 :: BCState = {
23 freshl :: [Int],
24 freshs :: [Int],
25 sdss :: [BCShare]
26 }
27
28 class toByteCode a :: a -> String
29 class fromByteCode a :: String -> a
30 class mTaskType a | toByteCode, fromByteCode, iTask, TC a
31
32 instance toByteCode Int, ... , UserLED, BCValue
33 instance fromByteCode Int, ... , UserLED, BCValue
34
35 instance arith ByteCode
36 ...
37 instance serial ByteCode
38 \end{lstlisting}
39
40 \section{Bytecode compilation view for \gls{mTask}}
41 Compilation to bytecode
42
43 \subsection{Backend}
44 \todo{Aanpassingen
45 aan de mTask DSL}
46
47 \section{Semantics}
48
49 \todo{Uitleggen wat het systeem precies doet}
50