--- /dev/null
+all:
+ ./build
while read l; do deps "$l"; done
}
+graphicdeps(){
+ grep -Pzo '\\includegraphics[%\t\n ]*(\[.*\])?[%\t\n ]*\{.*?\}' $1 |\
+ tr '\0' '\n' | grep -Po '(?<=\{).*?(?=\})' |\
+ while read l; do echo "$2/$l"; done
+}
+
+graphicspath(){
+ :
+}
+
recompile(){
for dep in $(deps "$1"); do
if [ "$dep" -nt "$2" ]; then
\item Interrupts
\end{itemize}
\end{frame}
+
+\subsection{Demo}
+\begin{frame}
+ \frametitle{And ofcourse\ldots\pause{} a demo}
+ \pause{}
+ \begin{figure}
+ \centering
+ \includegraphics[width=.6\linewidth]{demo}
+ \end{figure}
+\end{frame}
\item Monitoring (Temperature, Electricity, Humidity, Heartbeat)
\item Acting (Servo's, Motors)
\item Tracking (GPS, WiFi tracking)
- \item Relaying (SMS, Whatsapp)
+ \item Communication (SMS, Whatsapp)
\pause{}
- \item Combinations: e.g. Thermostat
- \item Smart clothing, smart watches
+ \item Combinations: e.g. Thermostat, Smart Clothing, Smart Watches
\end{itemize}
\end{block}
\end{frame}
\pause{}
\item Heaps of communication methods: LoRa (Sigfox, KPN, TTN), BTLE, WiFi, ZigBee\ldots
\pause{}
- \item But\ldots
- \pause{}
\item Separated logic
\item Integration problems
- \item Reprogramming, write cycles
\end{itemize}
\end{frame}
\frametitle{And there is TOP/iTasks}
\begin{block}{iTasks}
\begin{itemize}[<+->]
- \item Basic blocks
+ \item Tasks are basic blocks
\item Generated web interface
\item Type driven
\item EDSL
\item iTasks server
\item IoT device client
\item EDSL to make IoT tasks
- \item Interpreted on the client
- \item No reprogramming
+ \item Internalship
\end{itemize}
- \pause{}
- Internalship
\end{frame}
\begin{frame}
\item Write client software
\item Write server software
\item Connect them up
+ \item But first some theory
+ \item Reprogramming, write cycles
\end{itemize}
\end{frame}
\begin{itemize}[<+->]
\item Read function
\item Write function
+ \item Both have access to the world
\end{itemize}
\end{block}
\end{lstlisting}
\end{frame}
-\begin{frame}[fragile]
- \frametitle{SDS (2)}
- \framesubtitle{Parametric Lenses}
- \begin{block}{What is the \CI{p} for in \CI{RWShared p r w}}
- \pause{}
- \begin{itemize}
- \item Parameter fixed when writing
- \item Used for notifications
- \end{itemize}
- \end{block}
-
- \begin{lstlisting}
-sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p
-
-:: SDSNotifyPred p :== p -> Bool
-:: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
- | SDSReadConst (p -> r)
-:: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
- | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
-:: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
- | SDSNotifyConst (p -> w -> SDSNotifyPred p)
-
-sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws)
- (SDSLensNotify p w rs) (RWShared ps rs ws) -> RWShared p r w | iTask ps
- \end{lstlisting}
-\end{frame}
-
\begin{frame}
- \frametitle{Why add IoT devices to iTasks}
- \begin{block}{Why?}
- \begin{itemize}
- \item Execute Tasks
- \item Monitoring
- \item Hardware
- \end{itemize}
- \end{block}
-
- \pause{}
-
- \begin{block}{Current possibilities}
- \begin{itemize}
- \item Implement a device as an SDS
- \pause{}
- \item Tailor made SDS for every task
- \item Difficult to get logic in
- \pause{}
- \item Arjan's Distributed iTasks
- \pause{}
- \item Requires fast hardware
- \pause{}
- \end{itemize}
- \end{block}
-\end{frame}
-
-\begin{frame}
- \frametitle{Solution}
- \pause{}
- \begin{block}{EDSL to the rescue}
- \pause{}
- After the break.
- \end{block}
+ \frametitle{But not all Tasks or SDSs are suitable for microcontrollers\ldots}
+ \pause\centering\Large EDSLs to the rescue
\end{frame}
\item Language in a language
\item Use the properties of the host
\item E.g., Ivory, \ldots\pause{} and iTasks
+ \pause{}
+ \item Different embedding techniques
\end{itemize}
\end{frame}
\pause{}
\begin{block}{What is mTask}
\begin{itemize}
+ \item Created by Pieter Koopman and Rinus Plasmeijer
\item EDSL
\item Arduino C++ generation, iTasks simulation
\end{itemize}
\begin{frame}[fragile]
\frametitle{Expressions}
\begin{block}{mTask}
- \begin{itemize}
- \item Two phantom types
- \item Hierarchy
+ \begin{itemize}[<+->]
+ \item Of the form \CI{v t p}
+ \item \CI{p} is hierarchical
\end{itemize}
\end{block}
\pause{}
\begin{lstlisting}
class arith v where
lit :: t -> v t Expr
- (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | +, zero t & isExpr p & isExpr q
- (-.) infixl 6 :: (v t p) (v t q) -> v t Expr | -, zero t & ...
+ (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | +, zero t & isExpr p & isExpr q
+ (-.) infixl 6 :: (v t p) (v t q) -> v t Expr | -, zero t & ...
...
class boolExpr v where
Not :: (v Bool p) -> v Bool Expr | ...
\begin{frame}[fragile]
\frametitle{Control flow}
\begin{lstlisting}
-class If v q r ~s where
- If :: (v Bool p) (v t q) (v t r) -> v t s | ...
-
class IF v where
IF :: (v Bool p) (v t q) (v s r) -> v () Stmt | ...
(?) infix 1 :: (v Bool p) (v t q) -> v () Stmt | ...
-instance If Code Stmt Stmt Stmt
-instance If Code e Stmt Stmt
-instance If Code Stmt e Stmt
-instance If Code x y Expr
-
class seq v where
(:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | ...
\end{lstlisting}
\begin{lstlisting}
blink = task \blink=(\x.
IF (x ==. lit True)
- (ledOn led)
- (ledOff led) :.
+ (ledOn LED1)
+ (ledOff LED2) :.
blink (lit 1000) (Not x))
In {main=blink (lit 1000) True}
\subsection{Overview}
+\begin{frame}
+ \frametitle{Current state of mTask}
+ \begin{itemize}
+ \item It all seems perfect
+ \item \ldots\pause{} but\ldots
+ \pause{}
+ \item No interaction
+ \item Compilation requires reprogramming
+ \item Entire system is created and fixed
+ \end{itemize}
+\end{frame}
+
\begin{frame}
\frametitle{Solution}
- \begin{block}{Downsides of the current mTask view}
- \begin{itemize}
- \item It all seems perfect
- \item \ldots\pause{} but\ldots
- \pause{}
- \item No interaction
- \item Compilation requires reprogramming
- \end{itemize}
- \end{block}
- \pause{}
- \begin{block}{Solution}
- \begin{itemize}[<+->]
- \item New bytecode backend for mTask
- \item Interpreter on client
- \item Server in iTasks with integration
- \item No taskserver generation, onetime programming
- \item Explicit SDS publishing
- \end{itemize}
- \end{block}
+ \begin{itemize}[<+->]
+ \item New bytecode backend for mTask
+ \item Interpreter on client
+ \item Server in iTasks with integration
+ \item No taskserver generation, onetime programming
+ \item Dynamic task sending
+ \item Explicit SDS publishing
+ \end{itemize}
\end{frame}
\subsection{Extending mTask}
\end{lstlisting}
\end{frame}
-\begin{frame}[fragile]
- \frametitle{Functionality}
- \begin{block}{SDS scope and naming}
- \begin{itemize}
- \item SDS is lost
- \item State per device
- \item Tasks are sent and gone
- \item Save bandwidth
- \end{itemize}
- \pause{}
- \begin{lstlisting}
-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{Functionality}
+% \begin{block}{SDS scope and naming}
+% \begin{itemize}
+% \item SDS is lost
+% \item State per device
+% \item Tasks are sent and gone
+% \end{itemize}
+% \pause{}
+% \begin{lstlisting}
+%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}
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)
+
makeStore [BCSdsFetch i] = [BCSdsStore i]
makeStore [BCDigitalRead i] = [BCDigitalWrite i]
makeStore [...] = [...]
\end{lstlisting}
\end{frame}
+
\begin{frame}[fragile]
\frametitle{Task scheduling}
\begin{block}{Old}
\end{frame}
\subsection{Server}
+\begin{frame}[fragile]
+ \frametitle{SDS (2)}
+ \framesubtitle{Parametric Lenses}
+ \begin{block}{What is the \CI{p} for in \CI{RWShared p r w}}
+ \pause{}
+ \begin{itemize}
+ \item Parameter fixed when writing
+ \item Used for notifications
+ \item On write the SDS returns \CI{p -> Bool}
+ \end{itemize}
+ \end{block}
+%
+% \begin{lstlisting}
+%sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p
+%
+%:: SDSNotifyPred p :== p -> Bool
+%:: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
+% | SDSReadConst (p -> r)
+%:: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
+% | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
+%:: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
+% | SDSNotifyConst (p -> w -> SDSNotifyPred p)
+%
+%sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws)
+% (SDSLensNotify p w rs) (RWShared ps rs ws) -> RWShared p r w | iTask ps
+% \end{lstlisting}
+\end{frame}
\subsection{Examples}
-\documentclass{beamer}
+\documentclass[handout]{beamer}
\usepackage{listings} % Source code
\usepackage{subcaption} % Subcaptions
\section{Introduction}
\input{pres.intro}
-%\section{EDSLs \& mTask}
-%\input{pres.mtask}
-%
-%\section{System Overview}
-%\input{pres.system}
+\section{EDSLs \& mTask}
+\input{pres.mtask}
+
+\section{System Overview}
+\input{pres.system}
\section{Conclusion}
\input{pres.conclusion}
-\section{Demo}
-\begin{frame}
- \frametitle{And ofcourse\ldots\pause{} a demo}
- \pause{}
- \begin{figure}
- \centering
- \includegraphics[width=.6\linewidth]{demo}
- \end{figure}
-\end{frame}
-
\end{document}