LATEX?=pdflatex
BIBTEX?=bibtex
BIBTEXFLAGS:=
-MAKEGLOSSARIES?=makeglossaries
-MAKEGLOSSARIESFLAGS?=
-LATEXFLAGS:=\
- -file-line-error\
- -halt-on-error\
- -no-shell-escape
-
-FIGURES:=$(addsuffix .png,$(addprefix img/,$(notdir $(basename $(wildcard fig/*.dot)))))
+MAKEGL?=makeglossaries
+MAKEGLFLAGS?=
+LATEXFLAGS:=-file-line-error -halt-on-error -no-shell-escape
+
+FIGURES:=$(patsubst fig/%.dot,img/%.png,$(wildcard fig/*.dot))
LISTINGS:=$(wildcard listings/*)
TEXS:=$(wildcard *.bib)
BIBS:=$(wildcard *.tex)
.PHONY: all clean
-.SECONDARY: $(addsuffix .fmt,$(DOCS)) $(FIGURES)
+.SECONDARY: $(DOCS:%=%.fmt) $(FIGURES)
-all: $(addsuffix .pdf,$(DOCS))
+all: $(DOCS:%=%.pdf)
%.fmt: %.pre
$(LATEX) $(LATEXFLAGS) -ini -jobname="$(basename $<)" "&$(LATEX) $<\dump"
%.mlog: %.tex %.fmt $(BIBS) $(TEXS) $(FIGURES) $(LISTINGS)
$(LATEX) $(LATEXFLAGS) $<
if $(GREP) -q '^\\bibdata{' $(basename $<).aux; then $(BIBTEX) $(BIBTEXFLAGS) $(basename $<); fi
- if $(GREP) -q '\@istfilename' $(basename $<).aux; then $(MAKEGLOSSARIES) $(MAKEGLOSSARIESFLAGSFLAGS) $(basename $<); fi
+ if $(GREP) -q '\@istfilename' $(basename $<).aux; then $(MAKEGL) $(MAKEGLFLAGS) $(basename $<); fi
$(LATEX) $(LATEXFLAGS) $< | tee $@
img/%.png: fig/%.dot
dot -Tpng $< > $@
-clean: $(addprefix clean-,$(DOCS))
- $(RM) -v $(FIGURES)
+clean: $(DOCS:%=clean-%)
+ $(RM) $(FIGURES)
clean-%:
- $(RM) -v $(addprefix $(@:clean-=).,acn acr alg aux bbl blg fmt glg glo\
- gls ist lof log lol lot out pdf tdo toc)
+ $(RM) $(addprefix $(@:clean-%=%).,acn acr alg aux bbl blg fmt glg glo\
+ gls ist lof log lol lot mlog out pdf tdo toc)
--- /dev/null
+\newacronym{GADT}{GADT}{Generalized Algebraic Datatype}
+\newacronym{GPIO}{GPIO}{General-Purpose Input/Output}
+\newacronym{ADT}{ADT}{Algebraic Datatype}
+\newacronym{SDS}{SDS}{Shared Data Source}
+\newacronym{IoT}{IoT}{Internet of Things}
+\newacronym{TOP}{TOP}{Task Oriented Programming}
+\newacronym{EDSL}{(E)DSL}{(Embedded) Design Specific Language}
+\newacronym{RISC}{RISC}{Reduced Instruction Set Computer}
+\newacronym{ARM}{ARM}{Acorn \acrshort{RISC} Machine}
+\newacronym{LTN}{LTN}{Low Throughput Network}
+\newacronym{IDE}{IDE}{Integrated Development Environment}
+\newacronym{TCP}{TCP}{Transmission Control Protocol}
+\newacronym{RFID}{RFID}{Radio-Frequency Identification}
+\newacronym{GPS}{GPS}{Global Positioning System}
+\newacronym{RTOS}{RTOS}{Real-Time Operating System}
+\newacronym{LCD}{LCD}{Liquid Crystal Display}
\section{Conclusion}
+This thesis introduces a new view for the existing \gls{mTask}-\gls{EDSL}.
+The new view for the \gls{EDSL} compiles the language in to bytecode that can
+be interpreted by an \gls{mTask}-client. Clients have been written for several
+microcontrollers and consumer architectures that can be connected through
+various means of communication such as serial, bluetooth, wifi and wired
+network communication. The bytecode on the devices is interpreted using a
+simple stack machine and provides the programmer interfaces to the peripherals.
+The semantics of the \glspl{mTask} tries to resemble the \gls{iTasks} semantics
+as close as possible.
+
+The host language has a very efficient compiler and code generator the
+\gls{mTask}-system is also relatively fast because the compilation of
+\glspl{mTask} is nothing more than running some functions in the host language.
+
+The dynamic nature allows the microcontroller to be programmed once and used
+many times. The program memory of microcontrollers often guarantees around
+$10.000$ write or upload cycles and therefore existing techniques such as
+generating \gls{C} code are not usable for dynamic \gls{Task} environments.
+The dynamic nature also allows the programmer to design fail-over mechanisms.
+When a device is assigned a \gls{Task} but another device suddenly becomes
+unusable the \gls{iTasks} system can reassign a new \gls{mTask}-\gls{Task} to
+the first device that possibly takes over some of the functionality of the
+broken device without needing to recompile the code.
+
\section{Discussion}
\section{Future Research}
+Future improvements of the system could be:
+\begin{itemize}
+ \item Add an additional simulation view to the \gls{mTask}-\gls{EDSL} that
+ simulates the bytecode interpreter and possibly functions as a full
+ fledged device, thus handling all communication through the existing
+ system.
+ \item Add true multitasking to the client software allowing
+ \gls{mTask}-\glspl{Task} to run truly parallel. This does require
+ separate stacks for each task and therefore increases the system
+ requirements of the client software. However, it could be implemented
+ as a compile-time option and exchanged during the handshake so that the
+ server knows the multithreading capabilities of the client.
+ \item Resource analysis during compilation can be useful to determine if an
+ \gls{mTask}-\gls{Task} is suitable for a specific device. If the device
+ does not contain the correct peripherals such as an \gls{LCD} then the
+ \gls{mTask}-\gls{Task} should be rejected and feedback to the user must
+ be given. This could also be extended to minimum stack size needed to
+ run the task and memory requirements for storing the \gls{Task}.
+ \item Implement more \gls{Task} combinators such as the step combinator to
+ allow for more fine-grained control flow between
+ \gls{mTask}-\glspl{Task}. This could be extended to a similar system
+ as in the \gls{C}-code generation view. The \glspl{Task} can launch
+ other \glspl{Task} and compose \glspl{Task} of subtasks.
+\end{itemize}
--- /dev/null
+\newglossaryentry{Arduino}{name=Arduino,
+ description={is a cheap and popular microcontroller that is widely used for
+ rapid prototyping}}
+\newglossaryentry{Clean}{name=Clean,
+ description={is a staticly typed pure lazy functional programming language based on graph
+ rewriting}}
+\newglossaryentry{Haskell}{name=Haskell,
+ description={is a staticly typed pure lazy functional programming language}}
+\newglossaryentry{iTasks}{name=iTasks,
+ description={is a \acrshort{TOP} implementation written as a \acrshort{EDSL}
+ in the \gls{Clean} programming language}}
+\newglossaryentry{Ivory}{name=Ivory,
+ description={is a type-safe \gls{EDSL} designed to generate \gls{C}-code
+ for high-assurance low-level systems}}
+\newglossaryentry{Tower}{name=Tower,
+ description={is a type-safe \gls{EDSL} similar to \gls{Ivory} designed to
+ generate code for \acrlong{RTOS}}}
+\newglossaryentry{Task}{name=Task,
+ description={is the basic building block of a \acrshort{TOP} system}}
+\newglossaryentry{mTask}{name=mTask,
+ description={is an abstraction for \glspl{Task} living on \acrshort{IoT} devices}}
+\newglossaryentry{C}{name=C,
+ description={is low-level imperative programming language suitable for
+ embedded devices}}
+\newglossaryentry{C++}{name=C++,
+ description={is low-level imperative and object-oriented programming
+ language suitable for embedded devices based on \gls{C}}}
+\newglossaryentry{SAPL}{name=SAPL,
+ description={is an intermediate purely functional programming language}}
+\newglossaryentry{Firmata}{name=Firmata,
+ description={is standardized protocol for communicating with
+ microcontrollers}}
+\newglossaryentry{Javascript}{name=Javascript,
+ description={is an imperative programming language designed to run in web
+ browsers}}
+++ /dev/null
-\input{methods.top.tex}
-
-\input{methods.dsl.tex}
-
-\input{methods.mtask.tex}
+++ /dev/null
-\input{results.arch.tex}
-
-\input{results.mtask.tex}
\usepackage[nonumberlist,acronyms]{glossaries}
\makeglossaries%
-\newacronym{GADT}{GADT}{Generalized Algebraic Datatype}
-\newacronym{GPIO}{GPIO}{General-Purpose Input/Output}
-\newacronym{ADT}{ADT}{Algebraic Datatype}
-\newacronym{SDS}{SDS}{Shared Data Source}
-\newacronym{IoT}{IoT}{Internet of Things}
-\newacronym{TOP}{TOP}{Task Oriented Programming}
-\newacronym{EDSL}{(E)DSL}{(Embedded) Design Specific Language}
-\newacronym{RISC}{RISC}{Reduced Instruction Set Computer}
-\newacronym{ARM}{ARM}{Acorn \acrshort{RISC} Machine}
-\newacronym{LTN}{LTN}{Low Throughput Network}
-\newacronym{IDE}{IDE}{Integrated Development Environment}
-\newacronym{TCP}{TCP}{Transmission Control Protocol}
-\newacronym{RFID}{RFID}{Radio-Frequency Identification}
-\newacronym{GPS}{GPS}{Global Positioning System}
-\newacronym{RTOS}{RTOS}{Real-Time Operating System}
-\newglossaryentry{Arduino}{name=Arduino,
- description={is a cheap and popular microcontroller that is widely used for
- rapid prototyping}}
-\newglossaryentry{Clean}{name=Clean,
- description={is a staticly typed pure lazy functional programming language based on graph
- rewriting}}
-\newglossaryentry{Haskell}{name=Haskell,
- description={is a staticly typed pure lazy functional programming language}}
-\newglossaryentry{iTasks}{name=iTasks,
- description={is a \acrshort{TOP} implementation written as a \acrshort{EDSL}
- in the \gls{Clean} programming language}}
-\newglossaryentry{Ivory}{name=Ivory,
- description={is a type-safe \gls{EDSL} designed to generate \gls{C}-code
- for high-assurance low-level systems}}
-\newglossaryentry{Tower}{name=Tower,
- description={is a type-safe \gls{EDSL} similar to \gls{Ivory} designed to
- generate code for \acrlong{RTOS}}}
-\newglossaryentry{Task}{name=Task,
- description={is the basic building block of a \acrshort{TOP} system}}
-\newglossaryentry{mTask}{name=mTask,
- description={is an abstraction for \glspl{Task} living on \acrshort{IoT} devices}}
-\newglossaryentry{C}{name=C,
- description={is low-level imperative programming language suitable for
- embedded devices}}
-\newglossaryentry{C++}{name=C++,
- description={is low-level imperative and object-oriented programming
- language suitable for embedded devices based on \gls{C}}}
-\newglossaryentry{SAPL}{name=SAPL,
- description={is an intermediate purely functional programming language}}
-\newglossaryentry{Firmata}{name=Firmata,
- description={is standardized protocol for communicating with
- microcontrollers}}
-\newglossaryentry{Javascript}{name=Javascript,
- description={is an imperative programming language designed to run in web
- browsers}}
+\input{acronyms}
+\input{glossaries}
\begin{document}
\frontmatter{}
\chapter*{\centering Abstract}
\begin{quotation}
\centering\noindent
- \input{abstract.tex}
+ \input{abstract}
\end{quotation}
\chapter*{\centering Acknowledgements}
\begin{quotation}
\centering\it\noindent
- \input{acknowledgements.tex}
+ \input{acknowledgements}
\end{quotation}
%Table of contents
\mainmatter{}
\glsresetall{}
\chapter{Introduction}\label{chp:introduction}
-\input{introduction.tex}
+\input{introduction}
\chapter{\acrlong{TOP}}\label{chp:top}
-\input{methods.top.tex}
+\input{methods.top}
\chapter{\acrlongpl{EDSL}}\label{chp:dsl}
-\input{methods.dsl.tex}
+\input{methods.dsl}
\chapter{mTask}\label{chp:mtask}
-\input{methods.mtask.tex}
+\input{methods.mtask}
\chapter{Architecture}\label{chp:arch}
-\input{results.arch.tex}
+\input{results.arch}
\chapter{mTask continued}\label{chp:mtaskcont}
-\input{results.mtask.tex}
+\input{results.mtask}
\chapter{Conclusion \& Discussion}\label{chp:conclusion}
-\input{conclusion.tex}
+\input{conclusion}
\appendix\label{chp:appendix}
\chapter{Communication protocol}\label{app:communication-protocol}
-\input{appendix-protocol.tex}
+\input{appendix-protocol}
\chapter{Device client interface}\label{app:device-interface}
-\input{appendix-device-interface.tex}
+\input{appendix-device-interface}
\cleardoublepage{}
\phantomsection{}