-main = sds \x=1 In sds \pin=1 In
- { main =
- IF (digitalRead D3) (
- x =. x +. lit 1 :. pub x
- ) ( noOp
- ) :.
- IF (pinnetje ==. lit 1) (
- digitalWrite D0 (lit True)
- ) ( IF (pinnetje ==. lit 2) (
- digitalWrite D1 (lit True)
- ) ( digitalWrite D2 (lit True)
- )) }
+bc1 d = {main = ledOn d}
+bc2 d = {main = ledOff d}
+bc3 = sds \x=1 In sds \pin=1 In {main =
+ IF (digitalRead D3) (
+ x =. x +. lit 1 :.
+ pub x
+ ) (
+ noOp
+ ) :.
+ IF (pin ==. lit 1) (
+ ledOn LED1
+ ) (
+ IF (pin ==. lit 2) (
+ ledOn LED2
+ ) (
+ ledOn LED3
+ )
+ )}
-ledOn :: DigitalPin -> Main (ByteCode () Stmt)
-ledOn d = { main = digitalWrite d (lit True) :. noOp }
-
-ledOff :: DigitalPin -> Main (ByteCode () Stmt)
-ledOff d = { main = digitalWrite d (lit False) :. noOp }
\end{columns}
\end{frame}
+\begin{frame}
+ \frametitle{Architecture}
+ \begin{block}{Client}
+ \begin{itemize}
+ \item C code
+ \item Round robin scheduling
+ \item Check input, run tasks, sleep
+ \item Interval or one-shot
+ \end{itemize}
+ \end{block}
+
+ \begin{block}{Server}
+ \begin{itemize}
+ \item iTasks
+ \item Communication via SDS
+ \item Handle communication
+ \item Synchronize SDS
+ \end{itemize}
+ \end{block}
+\end{frame}
+
\begin{frame}
\frametitle{mTask}
\begin{block}{Properties}
\begin{frame}
\frametitle{Bytecode}
+ \begin{block}{State transformer}
+ \end{block}
\begin{tabular}{rllll}
\toprule
& \multicolumn{4}{c}{Current instructionset}\\
\midrule
Stack: & nop & push & pop\\
- SDSs: & sdsstore & sdsfetch & sdspublish\\
Boolean: & not & and & or\\
Arithmetic: & add & sub & mul & div\\
Compare: & eq,neq & les, gre & leq, geq\\
Control: & jmp & jmpt & jmpf\\
- Aux: & digitalread & digitalwrite & analogread & analogwrite\\
+ Aux: & ledOn & ledOff\\
+ Aux2: & digitalread & digitalwrite & analogread & analogwrite\\
\midrule
\pause%
& \multicolumn{4}{c}{Future}\\
\begin{frame}[fragile]
\frametitle{mTask}
\framesubtitle{cont.}
- \begin{lstlisting}[caption={Simplified DSL classes},language=Clean,basicstyle=\scriptsize]
-:: Main a = {main :: a}
-:: Upd = Upd
-:: Expr = Expr
-:: Stmt = Stmt
-:: MTask = MTask Int // String
-
-class arith v where
- lit :: t -> v t Expr | ...
- (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | ...
- ...
-class boolExpr v where
- (&.) infixr 3 :: (v Bool p) (v Bool q) -> v Bool Expr | ...
- ...
- (==.) infix 4 :: (v a p) (v a q) -> v Bool Expr | ...
- ...
- \end{lstlisting}
+ \lstinputlisting[language=Clean,basicstyle=\scriptsize]{edsl.listing}
\end{frame}
\begin{frame}[fragile]
\frametitle{mTask}
\framesubtitle{cont.}
- \begin{lstlisting}[caption={Control and auxilary},language=Clean,basicstyle=\scriptsize]
-:: In a b = In infix 0 a b
-
-class seq v where
- (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | ...
-class sds v where
- sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | ...
- pub :: (v t Upd) -> v t Expr | type t
-class assign v where
- (=.) infixr 2 :: (v t Upd) (v t p) -> v t Expr | type t & isExpr p
-class noOp v where noOp :: v t p
-class IF v where
- IF :: (v Bool p) (v t q) (v s r) -> v () Stmt | isExpr p
- (?) infix 1 :: (v Bool p) (v t q) -> v () Stmt | isExpr p
-class digitalIO v where
- digitalRead :: p -> v Bool Expr | pin, readPinD p
- digitalWrite :: p (v Bool q) -> v Bool Expr | pin, writePinD p
-class analogIO v where
- analogRead :: AnalogPin -> v Int Expr
- analogWrite :: AnalogPin (v Int p) -> v Int Expr
- \end{lstlisting}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{mTask}
- \framesubtitle{cont.}
- \begin{lstlisting}[caption={To implement},language=Clean,basicstyle=\scriptsize]
-class fun v t where
- fun :: ((t->v s Expr)->In (t->v s p) (Main (v u q))) -> Main (v u q) | type s
-class time v where
- delay :: (v Long p) -> (v Long Expr)
- millis :: (v Long Expr)
- \end{lstlisting}
+ \lstinputlisting[language=Clean,basicstyle=\scriptsize]{control.listing}
\end{frame}
\begin{frame}
\frametitle{SDS}
-
+ \lstinputlisting[language=Clean,basicstyle=\scriptsize]{sds.listing}
+ \pause%
+ \begin{itemize}
+ \item Pushed from server to client
+ \item Client has to specifically publish
+ \item Synchronized with a real SDS by the connection handlers
+ \item \CI{get}, \CI{set} and no \CI{upd}
+ \end{itemize}
+ \pause%
+ \begin{block}{Bytecode}
+ sdsstore, sdsfetch, sdspublish
+ \end{block}
\end{frame}
\begin{frame}[fragile]
\begin{frame}
\frametitle{Future}
- \begin{itemize}
+ \begin{itemize}[<+->]
\item Task combinators
+ \item Functions
+ \item Seamless integration with iTasks
\item Dynamic mTask/SDS allocation
+ \item Better integration with real SDS
\item More datatypes for SDS
\item Slicing tasks
\item Support for different devices
+ \item Master's Thesis
+ \item \ldots
\end{itemize}
\end{frame}