\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}