update planning
[msc-thesis1617.git] / methods.tex
1 \section{\acrlong{TOP}}
2 \gls{TOP} is a recent new programming paradigm implemented as
3 \gls{iTasks}~\cite{achten_introduction_2015} in
4 the pure lazy functional language \gls{Clean}
5
6 \todo{Main terms}
7 The lazy functional programming language based on graph rewriting
8 \gls{Clean}~\cite{brus_cleanlanguage_1987}
9
10 \section{\acrlong{EDSL}s}
11 \glspl{mTask} are expressed in a class based shallowly embedded \gls{EDSL}.
12 There are two main types of \glspl{EDSL}.
13 \todo{Small shallow embedded dsl intro}
14 \todo{Small deep embedded dsl}
15 \todo{Show that class based has the best of both worlds}
16
17 \section{Devices}
18 The client code for the devices is compiled from one codebase. For a device to
19 be eligible for \glspl{mTask} it must be able to compile the shared codebase
20 and implement (part of) the device specific interface. The shared codebase only
21 uses standard \gls{C} and no special libraries or tricks are used. Therefore
22 the code is compilable for almost any device or system. Note that it is not
23 needed to implement a full interface\todo{handshake}. The full interface,
24 listed in Appendix~\label{app:device-interface}\todo{update interface listing},
25 also includes functions for accessing the peripherals that not every device
26 might have. Devices can choose what to implement by setting the correct macros
27 in the top of the file.
28
29 \subsection{Specification}
30 Devices are stored in a record type and all devices in the system are stored in
31 a \gls{SDS} containing all devices. From the macro settings in the interface
32 file a profile is created for the device that describes the specification. When
33 a connection between the server and a client is established the server will
34 send a request for specification. The client will serialize his specs and send
35 it to the server so that the server knows what the client is capable of. The
36 exact specification is listed in Listing~\ref{lst:devicespec}
37
38 \begin{lstlisting}[language=Clean,label={lst:devicespec},
39 caption={Device specification for \glspl{mTask}}]
40 :: MTaskDeviceSpec =
41 {haveLed :: Bool
42 ,haveAio :: Bool
43 ,haveDio :: Bool
44 ,taskSpace :: Int // Bytes
45 ,sdsSpace :: Int // Bytes
46 }
47 \end{lstlisting}
48 \todo{Explain specification, combine task and share space}
49
50 \subsection{Communication}
51
52 \section{mTasks}
53 \subsection{\gls{EDSL}}
54
55
56 \subsection{Shares}