%&a
\begin{document}
\maketitleru[
	course={Research Intership},
	righttextheader={Supervisors:},
	righttext={P.W.M. Koopman\\M.J. Plasmeijers}]

\listoftodos[Todo]
\tableofcontents

\section{Introduction}
\input{intro.tex}

\section{mTasks}
\input{mtasks.tex}

\section{Architecture}
\subsection{Microcontroller}
\input{microcontroller.tex}

\subsection{Bytecode specification}
\todo{Bytecode specificatie}

\subsection{\iTasks{}}
\input{itasks.tex}

\subsection{Communication}
We can divide the communication up into two parts. Communication from the
\iTasks{} server to the microcontroller and vice versa. The means of
communicating are unimportant, this can be TCP, Serial or any other
communication method that sends data in a linear way. It must be noted that the
communication is not necessarily fast and thus these resources are scarce.
Therefore the architecture tries to minimize the usage of communication
resources.

\subsubsection{\iTasks{} \texorpdfstring{$\rightarrow$}{->} microcontroller}
\input{commim.tex}

\subsubsection{Microcontroller \texorpdfstring{$\rightarrow$}{->} \iTasks{}}
\input{commmi.tex}

\section{Conclusion}
\input{conclusion.tex}

\section{Improvements and future research}
In the current implementation the number of possible tasks that can run
simultaneously is fixed. A future project can implement dynamic task allocation
and garbage collection that is then needed. Since memory is scarce on a
microcontroller the program can not go and \verb#malloc# all the time to
allocate new memory on the heap for the tasks. Over time this will cause
fragmentation and eventually the program will run out of memory. A solution for
this could be to let the engine handle the memory management and reorder and
defragment the tasks on demand.

Another improvement could be the task scheduling. At the moment all tasks get
one slice in which they are executed as a whole. Because of this the use of
loops is not possible since a loop will block the entire program. A possible
solution for this is to give different stack and program pointers to each task
and save them separately. In this way the interpreter can slice the programs
and pause one to let another run and through this it will be possible to add
loops to the DSL and make the DSL even more imperative like.

\todo{Iets over task return values}

\todo{Iets over task combinators}

\bibliographystyle{ieeetr}
\bibliography{a}
\end{document}
