From: Mart Lubbers Date: Sun, 29 Jan 2017 11:00:46 +0000 (+0100) Subject: add stuff X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=b4e38bff24a08d841429082b91244182f813d8f6;p=ri1617.git add stuff --- diff --git a/final_review/praatje.pre b/final_review/praatje.pre index 33b1cd0..a26ffef 100644 --- a/final_review/praatje.pre +++ b/final_review/praatje.pre @@ -3,6 +3,7 @@ \usepackage[british]{babel} \usepackage{listings} \usepackage{clean} +\usepackage{booktabs} \title{iTasks and the Internet of Things} \subtitle{Research internship} diff --git a/final_review/praatje.tex b/final_review/praatje.tex index b43bb20..ae8d826 100644 --- a/final_review/praatje.tex +++ b/final_review/praatje.tex @@ -48,8 +48,10 @@ \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} @@ -71,10 +73,88 @@ \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}