-\section{Interpretations}
-This section describes all the interpretations tha the \gls{MTASK} language has.
-Not all of these interpretations are necessarily \gls{TOP} engines, i.e.\ not all of the interpretations execute the resulting tasks.
-Some may perform an analysis over the program or typeset the program so that a textual representation can be shown.
-
-\subsection{Pretty printer}
-The pretty printer interpretation converts the expression to a string representation.
-As the host language \gls{CLEAN} constructs the \gls{MTASK} expressions at run time, it can be useful to show the constructed expression at run time as well.
-The only function exposed for this interpretation is the \cleaninline{showMain} function (\cref{lst:showmain}).
-It runs the pretty printer and returns a list of strings containing the pretty printed result.
-The pretty printing function does the best it can but obviously cannot reproduce the layout, curried functions, and variable names.
-This shortcoming is illustrated by printing a blink task that contains a function and currying in \cref{lst:showexample}.
-
-\begin{lstClean}[caption={The entrypoint for the pretty printing interpretation.},label={lst:showmain}]
-:: Show a // from the mTask pretty printing library
-showMain :: (Main (Show a)) -> [String] | type a
-\end{lstClean}
-
-\begin{lstClean}[caption={Pretty printing interpretation example.},label={lst:showexample}]
-blinkTask :: Main (MTask v Bool) | mtask v
-blinkTask =
- fun \blink=(\state->
- writeD d13 state >>|. delay (lit 500) >>=. blink o Not
- ) In {main = blink true}
-
-// output:
-// fun f0 a1 = writeD(D13, a1) >>= \a2.(delay 1000)
-// >>| (f0 (Not a1)) in (f0 True)
-\end{lstClean}
-
-\subsection{Simulator}
-The simulator converts the expression to a ready-for-work \gls{ITASK} simulation.
-The task resulting from the \cleaninline{simulate} function presents the user with an interactive simulation environment (see \cref{lst:simulatemain,fig:sim}).
-The simulation allows the user to (partially) execute tasks, control the simulated peripherals, inspect the internal state of the tasks, and interact with \glspl{SDS}.
-
-\begin{lstClean}[caption={The entrypoint for the simulation interpretation.},label={lst:simulatemain}]
-:: TraceTask a // from the mTask simulator library
-simulate :: (Main (TraceTask a)) -> [String] | type a
-\end{lstClean}
-
-\begin{figure}
- \centering
- \includegraphics[width=\linewidth]{simg}
- \caption{Simulator interface for the blink program.}\label{fig:sim}
-\end{figure}
-
-\subsection{Byte code compiler}
-The main interpretation of the \gls{MTASK} system is the byte code compiler (\cleaninline{:: BCInterpret}).
-With it, and a handful of integration functions and tasks, \gls{MTASK} tasks can be executed on microcontrollers and integrated in \gls{ITASK} as if they were regular \gls{ITASK} tasks.
-Furthermore, with a special language construct, \glspl{SDS} can be shared between \gls{MTASK} and \gls{ITASK} programs as well.
-For this chapter, the focus lies on the language itself.
-The integration with \gls{ITASK} is explained thoroughly later in \cref{chp:integration_with_itask}.
-
-When using the byte code compiler interpretation in conjunction with the \gls{ITASK} integration, \gls{MTASK} is a heterogeneous \gls{DSL}.
-I.e.\ some components---for example the \gls{RTS} on the microcontroller that executes the tasks---is largely unaware of the other components in the system, and it is executed on a completely different architecture.
-The \gls{MTASK} language is based on a simply-typed $\lambda$-calculus with support for some basic types, arithmetic operations, and function definitions.
-This basic language is enriched with a task language to make it \gls{TOP} (see \cref{sec:top}).
-