3 \frametitle{What is Internet of Things (IoT)
}
6 \item 1999:
\pause{} RFID
7 \item Device to device communication
10 \item Estimated
30 billion in
2020
14 \begin{block
}{Tasks performed by IoT
}
16 \item Monitoring (Temperature, Electricity, Humidity, Heartbeat)
17 \item Acting (Servo's, Motors)
18 \item Tracking (GPS, WiFi tracking)
19 \item Relaying (SMS, Whatsapp)
21 \item Combinations: e.g. Thermostat
22 \item Smart clothing, smart watches
28 \frametitle{Problems with IoT
}
30 \item Device $
\rightarrow$ Server $
\rightarrow$ Application
32 \item Myriads of devices: Arduino, ESP8266, Raspberry pi
\ldots
34 \item Tons of languages: C++, Lua, C, python
\ldots
36 \item Heaps of communication methods: LoRa (Sigfox, KPN, TTN), BTLE, WiFi, ZigBee
\ldots
41 \item Integration problems
42 \item Reprogramming, write cycles
47 \frametitle{And there is TOP/iTasks
}
51 \item Generated web interface
59 \item Filling in forms
60 \item Looking at data (Monitoring, Maps)
61 \item Act on data changes
67 \frametitle{IoT and TOP
}
68 \begin{block
}{Overlap
}
70 \item Tasks often involve humans
71 \item Possibly far away
75 \begin{block
}{But how to integrate
}
77 \item iTasks' server is heavy
78 \item Distributed iTasks
80 \item Swat two flies at once
88 \item Add IoT to iTasks
89 \item Solve the integration problem
90 \item Extend the reach of iTasks
92 \item IoT device client
93 \item EDSL to make IoT tasks
94 \item Interpreted on the client
95 \item No reprogramming
100 \begin{frame
}[fragile
]
101 \frametitle{Task Oriented Programming
}
102 \framesubtitle{\ldots and iTasks
}
103 \begin{block
}{iTasks
}
104 \begin{itemize
}[<+->
]
106 \item Generated web interface
112 \column{.49\linewidth}
114 \begin{itemize
}[<+->
]
116 \item Given the state, a
\CI{TaskValue
} is observed.
117 \item Continuous execution
122 \column{.49\linewidth}
125 \includegraphics[width=
\linewidth]{fig-taskvalue
}
126 \caption{The states of a
\CI{TaskValue
}}
131 \begin{frame
}[fragile
]
132 \frametitle{Task Oriented Programming
}
133 \framesubtitle{Example
}
135 :: Name =
{ firstname :: String, lastname :: String
}
136 derive class iTask Name
138 enterInformation :: String
[EnterOption m
] -> Task m | iTask m
139 enterName :: Task Name
140 enterName = enterInformation "Enter your name"
[]
145 \begin{subfigure
}{.30\textwidth}
147 \includegraphics[width=
.9\linewidth]{taskex1
}
148 \caption{Initial interface\\~
}\label{fig:taskex1
}
150 \begin{subfigure
}{.30\textwidth}
152 \includegraphics[width=
.9\linewidth]{taskex2
}
153 \caption{Incomplete entrance
}\label{fig:taskex2
}
155 \begin{subfigure
}{.30\textwidth}
157 \includegraphics[width=
.9\linewidth]{taskex3
}
158 \caption{Complete entry\\~
}\label{fig:taskex3
}
160 \caption{Example of a generated user interface
}
164 \begin{frame
}[fragile
]
165 \frametitle{Task Oriented Programming (
3)
}
166 \framesubtitle{Combinators
}
167 \begin{block
}{Sequence
}
169 (>>=) infixl
1 :: (Task a) (a -> Task b) -> Task b | iTask a & iTask b
170 (>>*) infixl
1 :: (Task a)
[TaskCont a (Task b)
] -> Task b | iTask a & iTask b
172 = OnValue ((TaskValue a) -> Maybe b)
173 | OnAction Action ((TaskValue a) -> Maybe b)
174 | E.e: OnException (e -> b) & iTask e
175 | OnAllExceptions (String -> b)
176 :: Action = Action String
180 \begin{block
}{Parallel
}
182 (-||-) infixr
3 :: (Task a) (Task a) -> Task a | iTask a
183 ( ||-) infixr
3 :: (Task a) (Task b) -> Task b | iTask a & iTask b
184 (-|| ) infixl
3 :: (Task a) (Task b) -> Task a | iTask a & iTask b
185 (-&&-) infixr
4 :: (Task a) (Task b) -> Task (a,b) | iTask a & iTask b
190 \begin{frame
}[fragile
]
191 \frametitle{Shared Data Sources (SDS)
}
192 \begin{block
}{What is an SDS
}
193 \begin{itemize
}[<+->
]
200 :: RWShared p r w = ...
201 :: ReadWriteShared r w :== RWShared () r w
202 :: Shared r :== ReadWriteShared r r
204 get :: (ReadWriteShared r w) -> Task r | iTask r
205 set :: w (ReadWriteShared r w) -> Task w | iTask w
206 upd :: (r -> w) (ReadWriteShared r w) -> Task w | iTask r & iTask w
208 sharedStore :: String a -> Shared a | JSONEncode
{|*|
}, JSONDecode
{|*|
}
210 wait :: String (r -> Bool) (ReadWriteShared r w) -> Task r
214 \begin{frame
}[fragile
]
216 \framesubtitle{Parametric Lenses
}
217 \begin{block
}{What is the
\CI{p
} for in
\CI{RWShared p r w
}}
220 \item Parameter fixed when writing
221 \item Used for notifications
226 sdsFocus :: p1 (RWShared p1 r w) -> RWShared p2 r w | iTask p
228 :: SDSNotifyPred p :== p -> Bool
229 :: SDSLensRead p r rs = SDSRead (p -> rs -> MaybeError TaskException r)
230 | SDSReadConst (p -> r)
231 :: SDSLensWrite p w rs ws = SDSWrite (p -> rs -> w -> MaybeError TaskException (Maybe ws))
232 | SDSWriteConst (p -> w -> MaybeError TaskException (Maybe ws))
233 :: SDSLensNotify p w rs = SDSNotify (p -> rs -> w -> SDSNotifyPred p)
234 | SDSNotifyConst (p -> w -> SDSNotifyPred p)
236 sdsLens :: String (p -> ps) (SDSLensRead p r rs) (SDSLensWrite p w rs ws)
237 (SDSLensNotify p w rs) (RWShared ps rs ws) -> RWShared p r w | iTask ps
242 \frametitle{Why add IoT devices to iTasks
}
253 \begin{block
}{Current possibilities
}
255 \item Implement a device as an SDS
257 \item Tailor made SDS for every task
258 \item Difficult to get logic in
260 \item Arjan's Distributed iTasks
262 \item Requires fast hardware
269 \frametitle{Solution
}
271 \begin{block
}{EDSL to the rescue
}