X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=results.mtask.tex;h=c6adefb744f7d71e9b2dd47c6591be82751bc3b3;hb=36d2564cca6ffab6506198f13545e5d02cf2b5cc;hp=6496b7303fc0ee48923daf42f1d2ed42b4e71613;hpb=c7dbfdf743febd94770d3ce10d7d532a6bdd94cc;p=msc-thesis1617.git diff --git a/results.mtask.tex b/results.mtask.tex index 6496b73..c6adefb 100644 --- a/results.mtask.tex +++ b/results.mtask.tex @@ -1,11 +1,11 @@ -The \glspl{Task} suitable for a client are called \glspl{mTask} and are written -in the aforementioned \gls{mTask}-\gls{EDSL}. Some functionality of the -original \gls{mTask}-\gls{EDSL} will not be used in this system. Conversely, -some functionality needed was not available in the existing \gls{EDSL}. Due to -the nature of class based shallow embedding this obstacle is easy to -solve. A type --- housing the \gls{EDSL} --- does not have to implement all the -available classes. Moreover, classes can be added at will without interfering -with the existing views. +The \glspl{Task} suitable for a client are called \gls{mTask}-\gls{Task} and +are written in the aforementioned \gls{mTask}-\gls{EDSL}. Some functionality of +the original \gls{mTask}-\gls{EDSL} will not be used in this system. +Conversely, some functionality needed was not available in the existing +\gls{EDSL}. Due to the nature of class based shallow embedding this obstacle is +easy to solve. A type --- housing the \gls{EDSL} --- does not have to implement +all the available classes. Moreover, classes can be added at will without +interfering with the existing views. \section{\gls{Task} Semantics} The current \gls{mTask} engine for devices does not support \glspl{Task} in the @@ -63,9 +63,9 @@ class sdspub v where \end{lstlisting} \section{Bytecode compilation view}\label{sec:compiler} -The \glspl{mTask} are sent to the device in bytecode and are saved in the -memory of the device. To compile the \gls{EDSL} code to bytecode, a view is -added to the \gls{mTask}-system encapsulated in the type \CI{ByteCode}. As +The \gls{mTask}-\glspl{Task} are sent to the device in bytecode and are saved +in the memory of the device. To compile the \gls{EDSL} code to bytecode, a view +is added to the \gls{mTask}-system encapsulated in the type \CI{ByteCode}. As shown in Listing~\ref{lst:bcview}, the \CI{ByteCode} view is a boxed \gls{RWST} that writes bytecode instructions (\CI{BC}, Subsection~\ref{sec:instruction}) while carrying around a \CI{BCState}. The state is kept between compilations @@ -232,13 +232,13 @@ instance noOp ByteCode where noOp = tell` [BCNop] \end{lstlisting} -The semantics for the \glspl{mTask} bytecode view are different from the -semantics of the \gls{C} view. \glspl{Task} in the \gls{C} view can start new -\glspl{Task} or even start themselves to continue, while in the bytecode view, -\glspl{Task} run indefinitly, one-shot or on interrupt. To allow interval and -interrupt \glspl{Task} to terminate, a return instruction is added. This class -was not available in the original system and is thus added. It just writes a -single instruction so that the interpreter knows to stop execution. +The semantics for the \gls{mTask}-\glspl{Task} bytecode view are different from +the semantics of the \gls{C} view. \glspl{Task} in the \gls{C} view can start +new \glspl{Task} or even start themselves to continue, while in the bytecode +view, \glspl{Task} run indefinitly, one-shot or on interrupt. To allow interval +and interrupt \glspl{Task} to terminate, a return instruction is added. This +class was not available in the original system and is thus added. It just +writes a single instruction so that the interpreter knows to stop execution. Listing~\ref{lst:return} shows the classes and implementation for the return expression. @@ -277,7 +277,7 @@ addSDS sds v s = {s & sdss=[{sds & sdsval=BCValue v}:s.sdss]} \end{lstlisting} All assignable types compile to a \gls{RWST} which writes the specific fetch -instruction(s). For example, using a \gls{SDS} always results in an expression +instruction(s). For example, using an \gls{SDS} always results in an expression of the form \CI{sds \x=4 In ...}. The actual \CI{x} is the \gls{RWST} that always writes one \CI{BCSdsFetch} instruction with the correctly embedded \gls{SDS}. Assigning to an analog pin will result in the \gls{RWST} containing