From: Mart Lubbers Date: Sun, 9 Jul 2017 22:07:13 +0000 (+0200) Subject: probably final presentation version X-Git-Tag: final~10 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=952b9b6896f432e624c50556c68d6cd6d58005df;p=msc-thesis1617.git probably final presentation version --- diff --git a/pres.conclusion.tex b/pres.conclusion.tex index 28c5b49..d1c0d49 100644 --- a/pres.conclusion.tex +++ b/pres.conclusion.tex @@ -5,6 +5,7 @@ \item Shares propagate \item Easy to add peripherals \item Reasonably fast + \item But it is crude \item Lots of new questions opened \end{itemize} \end{frame} @@ -26,7 +27,6 @@ \begin{frame} \frametitle{And ofcourse\ldots\pause{} a demo} - \pause{} \begin{figure} \centering \includegraphics[width=.6\linewidth]{demo} diff --git a/pres.intro.tex b/pres.intro.tex index a2cb5b4..2ffc7ba 100644 --- a/pres.intro.tex +++ b/pres.intro.tex @@ -22,16 +22,14 @@ \begin{frame} \frametitle{Problems with IoT} - \begin{itemize} + \begin{itemize}[<+->] \item Device $\rightarrow$ Server $\rightarrow$ Application - \pause{} \item Myriads of devices: Arduino, ESP8266, Raspberry pi\ldots - \pause{} \item Tons of languages: C++, Lua, C, python\ldots - \pause{} \item Heaps of communication methods: LoRa (Sigfox, KPN, TTN), BTLE, WiFi, ZigBee\ldots - \pause{} + \item Resulting in \item Separated logic + \item Integration problems \end{itemize} \end{frame} @@ -46,7 +44,6 @@ \item EDSL in Clean \end{itemize} \end{block} - \pause{} \begin{block}{Tasks} \begin{itemize}[<+->] \item Filling in forms @@ -72,7 +69,7 @@ \begin{itemize} \item iTasks works \item IoT works - \item But...\pause{} integration does not + \item But\ldots\pause{} integration does not \end{itemize} \end{block} @@ -80,9 +77,10 @@ \begin{block}{Why is this interesting?} \begin{itemize}[<+->] - \item Make IoT integration easier + \item Makes IoT integration easier + \item Safer IoT clients \item Extend the reach of iTasks - \item Fully integrated systems + \item Generate all three components of IoT from one source \end{itemize} \end{block} \end{frame} @@ -96,13 +94,12 @@ \item Observables \item Given the state, a \CI{TaskValue} is observed. \item Continuous execution - \item Generics \end{itemize} \end{block} \pause{} \begin{figure}[ht] \centering - \includegraphics[width=\linewidth]{fig-taskvalue} + \includegraphics[width=.6\linewidth]{fig-taskvalue} \caption{The states of a \CI{TaskValue}} \end{figure} \end{frame} @@ -169,10 +166,12 @@ enterName = enterInformation "Enter your name" [] \begin{frame}[fragile] \frametitle{Shared Data Sources (SDS)} \begin{block}{What is an SDS} - \begin{itemize}[<+->] + \begin{itemize} \item Read function \item Write function + \pause{} \item Both have access to the world + \item Default: JSON file storage \end{itemize} \end{block} @@ -201,6 +200,6 @@ wait :: String (r -> Bool) (ReadWriteShared r w) -> Task r \end{frame} \begin{frame} - \frametitle{But not all Tasks or SDSs are suitable for microcontrollers\ldots} - \pause\centering\Large EDSLs to the rescue + \frametitle{How to express Tasks suitable for microcontrollers} + \pause\centering\Huge EDSLs to the rescue \end{frame} diff --git a/pres.mtask.tex b/pres.mtask.tex index 5865640..4b6f7d6 100644 --- a/pres.mtask.tex +++ b/pres.mtask.tex @@ -1,7 +1,7 @@ \subsection{EDSLs} \begin{frame} \frametitle{Embedded Domain Specific Language} - \framesubtitle{What is are EDSL} + \framesubtitle{What are EDSLs} \begin{itemize} \item DSL:\ language for a specific domain \item E.g., PostScript, VimScript, HTML, \ldots @@ -33,7 +33,9 @@ \item Easy to add views \item Hard to extend \item Not type safe - \pause\item GADT + \onslide<4->{ + \item GADT + } \end{itemize} \end{block} } @@ -111,6 +113,7 @@ Plus x y = \e -> x e + y e \item Extendable \item Type safe \item Easy to add views + \item Phantom types for extra constraints \end{itemize} \end{block} } @@ -228,8 +231,15 @@ class assign v where \end{lstlisting} \end{frame} + \begin{frame}[fragile] - \frametitle{Examples} + \frametitle{Tasks and Examples} + \begin{lstlisting}[language=Clean] +class mtask v a where + task :: (((v delay r) a -> v MTask Expr) -> In (a->v u p) (Main (v t q))) + -> Main (v t q) | ... + \end{lstlisting} + \pause{} \begin{lstlisting}[language=Clean] blink = task \blink=(\x. IF x diff --git a/pres.system.tex b/pres.system.tex index 18dc8cf..99fba52 100644 --- a/pres.system.tex +++ b/pres.system.tex @@ -28,12 +28,19 @@ \begin{frame}[fragile] \frametitle{Adding a View} \begin{lstlisting}[language=Clean] + :: ByteCode a p = BC (RWS () [BC] BCState ()) + +:: RWS r w s a = RWS (r s -> (a, s, w)) :: 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] } +class mTaskType a | toByteCode, fromByteCode, iTask, TC a +class toByteCode a :: a -> String +class fromByteCode a :: String -> a + instance ByteCode arith, boolExpr, ... \end{lstlisting} \end{frame} @@ -41,8 +48,9 @@ instance ByteCode arith, boolExpr, ... \begin{frame}[fragile] \frametitle{Implementation} \begin{itemize} - \item Writing instruction - \item Carrying state + \item Reader Write State Transformer Monad + \item Write instruction + \item Carry state \item Hand-crafted helpers \end{itemize} \begin{lstlisting}[language=Clean] @@ -73,8 +81,11 @@ instance arith ByteCode where 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 -... +instance IF ByteCode +where + IF b t e = BCIfStmt b t e + (?) b t = BCIfStmt b t (tell` []) + BCIfStmt (BC b) (BC t) (BC e) = BC ( freshlabel >>= \else->freshlabel >>= \endif-> b >>| tell [BCJmpF else] >>| @@ -98,8 +109,7 @@ instance sds ByteCode where instance assign ByteCode where (=.) (BC v) (BC e) = BC (e >>| censor makeStore v) -instance sdspub ByteCode where - pub (BC x) = BC (censor (\[BCSdsFetch s]->[BCSdsPublish s]) x) +addSDS sds v s = {s & sdss=[{sds & sdsval=BCValue v}:s.sdss]} makeStore [BCSdsFetch i] = [BCSdsStore i] makeStore [BCDigitalRead i] = [BCDigitalWrite i] @@ -114,26 +124,27 @@ makeStore [...] = [...] \begin{lstlisting} class sdspub v where pub :: (v t Upd) -> (v () Stmt) + instance sdspub ByteCode where - pub (BC x) = BC (censor (\[BCSdsFetch s]->[BCSdsPublish s]) x) + pub (BC x) + = BC (censor (\[BCSdsFetch s]->[BCSdsPublish s]) x) \end{lstlisting} \end{frame} \begin{frame}[fragile] \frametitle{Task scheduling} - \begin{block}{Old} + \begin{block}{Arduino C++ system} \begin{itemize} \item Task server \item Tasks start other tasks \end{itemize} \end{block} \pause{} - \begin{block}{New} + \begin{block}{Interpreted Bytecode system} \begin{itemize}[<+->] - \item Old system, taskserver, tasks start tasks - \item New system, task+strategy + \item Task accompanied with strategy \item \CI{OnShot}, \CI{OnInterval}, \CI{OnInterrupt} - \item How to handle termination + \item How to handle termination? \end{itemize} \pause{} \begin{lstlisting}[language=Clean] @@ -151,14 +162,12 @@ class retrn v where \item Modular implementation \item Specification generated from the macros \end{itemize} - + \pause{} \begin{lstlisting}[language=C,caption={interface.h}] ... #elif defined TARGET_STM32F767ZI #define APINS 128 -#define DPINS 128 -#define STACKSIZE 1024 -#define MEMSIZE 1024 +... #define HAVELED 1 #define HAVEHB 1 @@ -279,6 +288,7 @@ class MTaskDuplex a where \item Used for notifications \item On write the SDS returns \CI{p -> Bool} \end{itemize} + \pause{} \end{block} \begin{lstlisting}[language=Clean] sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p @@ -304,8 +314,7 @@ where realDeviceStore :: Shared [MTaskDevice] realDeviceStore = sharedStore "mTaskDevices" [] - realRead :: P *IWorld - -> (MaybeError TaskException [MTaskDevice], *IWorld) + realRead :: P *IWorld -> (MaybeError TaskException [MTaskDevice], *IWorld) realRead p iw = read realDeviceStore iw \end{lstlisting} \end{onlyenv} @@ -343,7 +352,7 @@ deviceShare d = mapReadWriteError Just d = Ok d) , \w ds->case splitWith ((==)d) ds of ([], _) = Error $ exception "Device lost" - ([_:_], ds) = Ok $ Just [w:ds]) + ([_], ds) = Ok $ Just [w:ds]) $ sdsFocus (Just (d, -1)) deviceStore shareShare :: MTaskDevice MTaskShare -> Shared BCValue @@ -354,11 +363,14 @@ shareShare :: MTaskDevice MTaskShare -> Shared BCValue \subsection{Communication} \begin{frame} \frametitle{The glue of the system} - \begin{itemize} - \item Compile, send and interact with Tasks - \item Interact with SDSs - \item All communication via channels - \end{itemize} + \pause{} + \begin{block}{Communication} + \begin{itemize} + \item Compile, send and interact with Tasks + \item Interact with SDSs + \item All communication via channels + \end{itemize} + \end{block} \end{frame} \begin{frame}[fragile] diff --git a/presentation.pre b/presentation.pre index e29ea69..5b966ae 100644 --- a/presentation.pre +++ b/presentation.pre @@ -1,4 +1,4 @@ -\documentclass[handout]{beamer} +\documentclass{beamer} \usepackage{listings} % Source code \usepackage{subcaption} % Subcaptions @@ -57,7 +57,7 @@ breaklines=true, captionpos=b, keepspaces=true, - basicstyle=\ttfamily\scriptsize\fontseries{l}, + basicstyle=\ttfamily\scriptsize, commentstyle=\slshape\fontseries{m}, keywordstyle=\bfseries\fontseries{b}, stringstyle=\ttfamily,