\begin{itemize}
\item Type-safe EDSL
\item Byte-compiled on the fly
+ \item Interpreted on the client
\item One codebase for different clients
- \item Communication via GSM, BT, Serial, TCP, \ldots
+ \item GSM, Bluetooth, Serial, TCP, \ldots
+ \pause%
\item mTasks
\end{itemize}
\end{block}
\item New view: Bytecode compilation.
\end{itemize}
\end{block}
-% \begin{table}
-%
-% \caption{Language elements mTask}
-% \end{table}
+\end{frame}
+
+\begin{frame}
+ \frametitle{Bytecode}
+ \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\\
+ \midrule
+ \pause%
+ & \multicolumn{4}{c}{Future}\\
+ \midrule
+ Aux extensions: & LCD & Serial & Shields\\
+ \bottomrule
+ \end{tabular}
+\end{frame}
+
+\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}
+\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}
\end{frame}
\begin{frame}