X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=pres.system.tex;h=4c8b2fbc5368f6b41ca304473d14c5ee80478c14;hb=4f4b21c04bc99e4e7d55a1dcbedbd371d97b2a05;hp=505e2a9c2a31c5efb655a7eeeea7951ef50c5025;hpb=5be4e2b2dc655e3e4572f67fb1f9243024a1fefe;p=msc-thesis1617.git diff --git a/pres.system.tex b/pres.system.tex index 505e2a9..4c8b2fb 100644 --- a/pres.system.tex +++ b/pres.system.tex @@ -15,10 +15,9 @@ \begin{itemize}[<+->] \item New bytecode backend for mTask \item Interpreter on client - \item Server in iTasks - \item Integration with iTasks - \item No taskserver generation - \item Program only once + \item Server in iTasks with integration + \item No taskserver generation, onetime programming + \item Explicit SDS publishing \end{itemize} \end{block} \end{frame} @@ -28,6 +27,7 @@ \frametitle{Adding a View} \begin{lstlisting} :: ByteCode a p = BC (RWS () [BC] BCState ()) +:: BC = BCNop | BCPush BCValue | ... :: BCValue = E.e: BCValue e & mTaskType, TC e :: BCShare = { sdsi :: Int, sdsval :: BCValue, sdsname :: String } :: BCState = { freshl :: Int, freshs :: Int, sdss :: [BCShare] } @@ -36,6 +36,52 @@ instance ByteCode arith, boolExpr, ... \end{lstlisting} \end{frame} +\begin{frame}[fragile] + \frametitle{Implementation} + \begin{itemize} + \item Writing instruction + \item Carrying state + \item Hand-crafted helpers + \end{itemize} + \begin{lstlisting} +op2 :: (ByteCode a p1) (ByteCode a p2) BC -> ByteCode b Expr +op2 (BC x) (BC y) bc = BC (x >>| y >>| tell [bc]) + +tell2 :: [BC] -> (ByteCode a p) +tell2 x = BC (tell x) + +instance arith ByteCode where + lit x = tell2 [BCPush (BCValue x)] + (+.) x y = op2 x y BCDiv + ... + \end{lstlisting} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Control flow} + \begin{itemize} + \item Use labels + \item Label resolving + \pause{} + \item Thus no reuse + \end{itemize} + \pause{} + \begin{lstlisting} +:: BC = ... | BCLab Int | ... + +freshlabel = get >>= \st=:{freshl}->put {st & freshl=freshl+1} >>| pure freshl + +instance If ByteCode Stmt Stmt Stmt where If b t e = BCIfStmt b t e +... +BCIfStmt (BC b) (BC t) (BC e) = BC ( + freshlabel >>= \else->freshlabel >>= \endif-> + b >>| tell [BCJmpF else] >>| + t >>| tell [BCJmp endif, BCLab else] >>| + e >>| tell [BCLab endif] + ) + \end{lstlisting} +\end{frame} + \begin{frame}[fragile] \frametitle{Functionality} \begin{block}{SDS scope and naming} @@ -43,6 +89,7 @@ instance ByteCode arith, boolExpr, ... \item SDS is lost \item State per device \item Tasks are sent and gone + \item Save bandwidth \end{itemize} \pause{} \begin{lstlisting} @@ -50,10 +97,32 @@ class namedsds v where namedsds :: ((v t Upd) -> In (Named t String) (Main (v c s))) -> (Main (v c s)) | ... :: Named a b = Named infix 1 a b + +instance sdspub ByteCode where + pub (BC x) = BC (censor (\[BCSdsFetch s]->[BCSdsPublish s]) x) \end{lstlisting} \end{block} \end{frame} +\begin{frame}[fragile] + \frametitle{Assignment} + \begin{lstlisting} +instance sds ByteCode where + sds f = {main = BC (freshshare + >>= \sdsi->pure {BCShare|sdsname="",sdsi=sdsi,sdsval=BCValue 0} + >>= \sds->pure (f (tell2 [BCSdsFetch sds])) + >>= \(v In bdy)->modify (addSDS sds v) + >>| unBC (unMain bdy)) + } + +instance assign ByteCode where + (=.) (BC v) (BC e) = BC (e >>| censor makeStore v) + +makeStore [BCSdsFetch i] = [BCSdsStore i] +makeStore [BCDigitalRead i] = [BCDigitalWrite i] +makeStore [...] = [...] + \end{lstlisting} +\end{frame} \begin{frame}[fragile] \frametitle{Task scheduling} \begin{block}{Old} @@ -84,6 +153,22 @@ class retrn v where \end{block} \end{frame} +\subsection{Interpretation} +\begin{frame}[fragile] + \frametitle{mTask implementation} + %TODO +\end{frame} + \subsection{Devices} +\begin{frame} + \frametitle{Devices} + \begin{itemize} + \item Standard C + \item Implement some classes in interface + \pause{} + \item How to handle termination + \end{itemize} +\end{frame} + \subsection{Server} \subsection{Examples}