updates
authorMart Lubbers <mart@martlubbers.net>
Fri, 25 Nov 2022 14:22:52 +0000 (15:22 +0100)
committerMart Lubbers <mart@martlubbers.net>
Fri, 25 Nov 2022 14:22:52 +0000 (15:22 +0100)
appx/c4hp.tex [moved from appx/clean_for_haskell_programmers.tex with 100% similarity]
concl/concl.tex [moved from concl/conclusion.tex with 100% similarity]
glossaries.tex
intro/intro.tex
preamble.tex
subfilepostamble.tex
thesis.tex
top/4iot.tex
top/int.tex
top/lang.tex

similarity index 100%
rename from concl/conclusion.tex
rename to concl/concl.tex
index 8bbc23d..3184d45 100644 (file)
@@ -17,7 +17,7 @@
 \myacronym{DSL}{DSL}{domain-specific language}
 \myacronym{ECO2}{eCO\textsubscript{2}}{equivalent carbon dioxide}
 \myacronym{EDSL}{eDSL}{embedded \glsxtrlong{DSL}}
-\myacronym[prefixfirst={a\ },prefix={an\ }]{FP}{functional programming}{functional programming}
+\myacronym[prefixfirst={a\ },prefix={an\ }]{FP}{FP}{functional programming}
 \myacronym[prefixfirst={a\ },prefix={an\ }]{FRP}{FRP}{functional reactive programming}
 \myacronym{GADT}{GADT}{generalised \glsxtrshort{ADT}}
 \myacronym{GHC}{GHC}{Glasgow \gls{HASKELL} Compiler}
index 6854812..ce27ffa 100644 (file)
@@ -1,28 +1,26 @@
 \documentclass[../thesis.tex]{subfiles}
 
 \input{subfilepreamble}
+\setcounter{chapter}{-1}
 
 \begin{document}
 \chapter{Prelude}%
 \label{chp:introduction}
 \begin{chapterabstract}
-       This chapter:
-       \begin{itemize}
-               \item introduces the topic and research ventures of this dissertation;
-               \item shows a reading guide;
-               \item provides background material on the \glsxtrlong{IOT}, \glsxtrlongpl{DSL}, \glsxtrlong{TOP}, \gls{ITASK}, and \gls{MTASK}.
-               \item and concludes with a detailed overview of the contributions.
-       \end{itemize}
+       This chapter is the introduction of the dissertation and to the thesis.
+       It first provides a general introduction to the topics and research venues taken in this document, ending with a reading guide.
+       The sections that follow provide background material on the \glsxtrlong{IOT}, \glsxtrlongpl{DSL}, \glsxtrlong{TOP}, \gls{ITASK}, and \gls{MTASK}.
+       Finally, it provides a detailed overview of the contributions.
 \end{chapterabstract}
 
 There are at least 13.4 billion devices connected to the internet at the time of writing\footnote{\url{https://transformainsights.com/research/tam/market}, accessed on: \formatdate{13}{10}{2022}}.
 Each and every one of those devices senses, acts, or otherwise interacts with people, other computers, and the environment surrounding us.
-Even though there is a substantial variety among these devices, they have one thing in common: they are all computers to some degree and hence require software to operate.
+Even though there is a substantial variety among these devices, they all have one thing in common: they are all computers and hence require software to operate.
 
 An increasing amount of these connected devices are so-called \emph{edge devices} that operate in the \gls{IOT}.
 Typically, these edge devices are powered by microcontrollers.
 Said microcontrollers contain integrated circuits accommodating a microprocessor designed for use in embedded applications.
-Typical edge devices are therefore tiny in size; have little memory; contain a slow, but energy-efficient processor; and allow for a lot of connectivity to connect peripherals such as sensors and actuators to interact with their surroundings.
+Typical edge devices are therefore tiny in size; have little memory; contain a slow, but energy-efficient processor; and allow for a lot of connectivity to connect peripherals such as sensors and actuators in order to interact with their surroundings.
 %
 %\begin{figure}[ht]
 %      \centering
@@ -31,26 +29,28 @@ Typical edge devices are therefore tiny in size; have little memory; contain a s
 %      \label{fig:esp_prototype}
 %\end{figure}
 
+Programming and maintaining \gls{IOT} systems is a complex and error-prone process.
 An \gls{IOT} programmer has to program each device and their interoperation using different programming paradigms, programming languages, and abstraction levels resulting in semantic friction.
-Programming and maintaining \gls{IOT} systems is therefore a very complex and an error-prone process.
 
 This thesis describes the research carried out around taming these complex \gls{IOT} systems using \gls{TOP}.
-\Gls{TOP} is an innovative tierless programming paradigm for programming multi-tier interactive systems using a single declarative specification of the work that needs to be done.
-By utilising advanced compiler technologies, much of the internals, communication, and interoperation of the multi-tiered applications is automatically generated.
-The result of this compilation is a ready-for-work application.
-For example, the \gls{TOP} system \gls{ITASK} can be used to program all layers of a distributed web application from a single source.
-Unfortunately, because the abstraction level is so high, the hardware requirements are too excessive for such systems to be suitable for the average edge device.
+\Gls{TOP} is an innovative tierless programming paradigm for interactive multi-tier systems.
+By utilising advanced compiler technologies, much of the internals, communication, and interoperation of the applications is automatically generated.
+From a single declarative specification of the work that needs to be done, the compiler makes a ready-for-work application.
+For example, the \gls{TOP} system \gls{ITASK} can be used to program all layers of a multi-user distributed web applications from a single source specification.
+Unfortunately, because the abstraction level is so high, the hardware requirements are too excessive for such systems to be suitable for the average \gls{IOT} edge device.
 
 This is where \glspl{DSL} are brought into play.
 \Glspl{DSL} are programming languages created with a specific domain in mind.
 Consequently, jargon does not have to be expressed in the language itself, but they can be built-in features.
-As a result, the hardware requirements can be drastically lower, even with high levels of abstraction.
+As a result, the hardware requirements can be drastically lower, even with high levels of abstraction for the specified domain.
 
 To bridge the gap between the \gls{IOT} edge devices, the \gls{MTASK} \gls{DSL} is used.
 \Gls{MTASK} is a novel programming language for programming \gls{IOT} edge devices using \gls{TOP}.
 As it is integrated with \gls{ITASK}, it allows for all layers of an \gls{IOT} application to be programmed from a single source.
+\todo{Kan deze \P\ weg? Aan\-ge\-zien het ook al in de volgende sectie staat}
 
-\section{Reading guide}
+\section{Reading guide}%
+\label{lst:reading_guide}
 The thesis is structured as a purely functional rhapsody.
 On Wikipedia, a musical rhapsody is defined as follows \citep{wikipedia_contributors_rhapsody_2022}:
 \begin{quote}\emph{%
@@ -69,7 +69,8 @@ Text typeset as \texttt{teletype} represents source code.
 Standalone source code listings are marked by the programming language used, e.g.\ \gls{CLEAN}\footnotemark, \gls{HASKELL}, \gls{CPP}, \etc.
 \footnotetext{\Cref{chp:clean_for_haskell_programmers} contains a guide for \gls{CLEAN} tailored to \gls{HASKELL} programmers.}
 
-\section{\texorpdfstring{\Glsxtrlong{IOT}}{Internet of things}}\label{sec:back_iot}
+\section{\texorpdfstring{\Glsxtrlong{IOT}}{Internet of things}}%
+\label{sec:back_iot}
 The \gls{IOT} is growing rapidly and it is changing the way people and machines interact with the world.
 While the term \gls{IOT} briefly gained interest around 1999 to describe the communication of \gls{RFID} devices \citep{ashton_internet_1999,ashton_that_2009}, it probably already popped up halfway the eighties in a speech by \citet{peter_t_lewis_speech_1985}:
 
@@ -84,7 +85,7 @@ These connected devices are already in households all around us in the form of s
 When describing \gls{IOT} systems, a tiered---or layered---architecture is often used for compartmentalisation.
 The number of tiers heavily depends on the required complexity of the model but for the intents and purposes of this thesis, the layered architecture as shown in \cref{fig:iot-layers} is used.
 
-\begin{figure}[ht]
+\begin{figure}
        \centering
        \includestandalone{iot-layers}
        \caption{A layered \gls{IOT} architecture.}%
@@ -119,22 +120,25 @@ With interpretation, a specialized interpreter is flashed in the program memory
 Interpretation always comes with an overhead, making it challenging to create them for small edge devices.
 However, the hardware requirements can be reduced by embedding domain-specific data into the programming language to be interpreted, so called \glspl{DSL}.
 
-\section{\texorpdfstring{\Glsxtrlongpl{DSL}}{Domain-specific languages}}\label{sec:back_dsl}
+\section{\texorpdfstring{\Glsxtrlongpl{DSL}}{Domain-specific languages}}%
+\label{sec:back_dsl}
 % General
-Programming languages can be divided up into two categories: \glspl{DSL}\footnote{Historically \glsxtrshortpl{DSL} have been called DSELs as well.} and \glspl{GPL} \citep{fowler_domain_2010}.
+Programming languages can be divided up into two categories: \glspl{DSL}\footnotemark\ and \glspl{GPL} \citep{fowler_domain_2010}.
+\footnotetext{Historically \glsxtrshortpl{DSL} have been called DSELs as well.}
 Where \glspl{GPL} are not made with a demarcated area in mind, \glspl{DSL} are tailor-made for a specific domain.
-Writing idiomatic domain-specific code in an \gls{DSL} is easy but this may come at the cost of the \gls{DSL} being less expressive to an extent that it may not even be Turing complete.
+Writing idiomatic domain-specific code in a \gls{DSL} is easy but this may come at the cost of the \gls{DSL} being less expressive to an extent that it may not even be Turing complete.
 \Glspl{DSL} come in two main flavours: standalone and embedded (\cref{sec:standalone_embedded})\footnote{Standalone and embedded are also called external and internal respectively.} of which \glspl{EDSL} can further be classified into heterogeneous and homogeneous languages (\cref{sec:hetero_homo}).
 This hyponymy is shown in \cref{fig:hyponymy_of_dsls}.
 
-\begin{figure}[ht]
+\begin{figure}
        \centering
        \includestandalone{hyponymy_of_dsls}
        \caption{A hyponymy of \glspl{DSL} (adapted from \citet[\citepage{2}]{mernik_extensible_2013})}%
        \label{fig:hyponymy_of_dsls}
 \end{figure}
 
-\subsection{Standalone and embedded}\label{sec:standalone_embedded}
+\subsection{Standalone and embedded}%
+\label{sec:standalone_embedded}
 \glspl{DSL} where historically created as standalone languages, meaning that all machinery is developed solely for the language.
 The advantage of this approach is that the language designer is free to define the syntax and type system of the language as they wish, not being restricted by any constraint.
 Unfortunately it also means that they need to develop a compiler or interpreter for the language, making standalone \glspl{DSL} costly to create.
@@ -148,7 +152,8 @@ If the syntax of the host language is not very flexible, the syntax of the \gls{
 Furthermore, \gls{DSL} errors shown to the programmer may be larded with host language errors, making it difficult for a non-expert of the host language to work with the \gls{DSL}.
 \Gls{FP} languages are especially suitable for hosting embedded \glspl{DSL} because they often have strong and versatile type systems, minimal but flexible syntax and offer referential transparency.
 
-\subsection{Heterogeneity and homogeneity}\label{sec:hetero_homo}
+\subsection{Heterogeneity and homogeneity}%
+\label{sec:hetero_homo}
 \Citet{tratt_domain_2008} applied a notion from metaprogramming \citep{sheard_accomplishments_2001} to \glspl{EDSL} to define homogeneity and heterogeneity of \glspl{EDSL} as follows:
 
 \begin{quote}
@@ -167,7 +172,8 @@ In fact, \gls{ITASK} and \gls{MTASK} are embedded \glspl{DSL}.
 \Gls{ITASK} runs in its host language as well so it is a homogeneous \gls{DSL}.
 Tasks written using \gls{MTASK} are serialised and executed on \gls{IOT} edge devices and it is therefore a heterogeneous \gls{DSL}.
 
-\section{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}\label{sec:back_top}
+\section{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}%
+\label{sec:back_top}
 \Gls{TOP} is a recent declarative programming paradigm for modelling interactive systems \citep{plasmeijer_task-oriented_2012}.
 \Citet{steenvoorden_tophat_2022} defines two instruments for \gls{TOP}: \gls{TOP} languages and \gls{TOP} engines.
 The language is the \emph{formal} language for specifying interactive systems.
@@ -177,7 +183,7 @@ Instead of dividing problems into \gls{LSOC} \gls{TOP} deals with separation of
 From the data types, utilising various \emph{type-parametrised} concepts, all other aspects are handled automatically (see \cref{fig:tosd}).
 This approach to software development is called \gls{TOSD} \citep{wang_maintaining_2018}.
 
-\begin{figure}[ht]
+\begin{figure}
        \centering
        \begin{subfigure}[t]{.5\textwidth}
                \centering
@@ -189,7 +195,7 @@ This approach to software development is called \gls{TOSD} \citep{wang_maintaini
                \includestandalone{tosd}
                \caption{\Gls{TOSD} approach.}
        \end{subfigure}
-       \caption{Separation of concerns in a traditional setting compared to \gls{TOSD} (adapted from~\cite[\citepage{20}]{wang_maintaining_2018}).}%
+       \caption{Separation of concerns in a traditional setting compared to \gls{TOSD} (adapted from \citep[\citepage{20}]{wang_maintaining_2018}).}%
        \label{fig:tosd}
 \end{figure}
 
@@ -216,12 +222,12 @@ This approach to software development is called \gls{TOSD} \citep{wang_maintaini
                The \gls{UOD} is explicitly and separately modelled by the relations that exist in the functions of the host language.
 \end{description}
 
-Applying the concepts of \gls{LSOC} to \gls{IOT} systems can broadly be done in two ways:
+Applying the concepts of \gls{LSOC} to \gls{IOT} systems can be done in two ways.
 Firstly, edge devices can be seen as simple resources, thus accessed through the resource access layer.
 The second view is that edge devices contain miniature \gls{LSOC} systems in itself as well.
 In \gls{TOSD} the same can be applied.
 The individual components in the miniature systems, the tasks, the \glspl{SDS}, are connected to the main system.
-%\todo[inline]{Is deze \P{} duidelijk genoeg?}
+\todo{Is deze \P\ dui\-de\-lijk genoeg of \"uberhaupt nodig?}
 
 \subsection{\texorpdfstring{\Gls{ITASK}}{ITask}}
 The concept of \gls{TOP} originated from the \gls{ITASK} framework, a declarative interactive systems language and \gls{TOP} engine for defining multi-user distributed web applications implemented as an \gls{EDSL} in the lazy pure \gls{FP} language \gls{CLEAN} \citep{plasmeijer_itasks:_2007,plasmeijer_task-oriented_2012}.
@@ -235,7 +241,7 @@ Using task combinators (e.g.\ \cleaninline{>>!} at \cref{lst:task_comb}), the ta
 Only when the user enters a complete value in the web editor, then the continue button enables and the result can be viewed.
 Special combinators (e.g.\ \cleaninline{@>>} at \cref{lst:task_ui}) are used to tweak the \gls{UI} so that informative labels are displayed.
 
-\begin{figure}[ht]
+\begin{figure}
        \includegraphics[width=.325\linewidth]{person0g}
        \includegraphics[width=.325\linewidth]{person1g}
        \includegraphics[width=.325\linewidth]{person2g}
@@ -297,6 +303,8 @@ intBlink iInterval =
        In {main = blink true}[+\label{lst:intro:mtask_to}+]
 \end{lstClean}
 
+\todo{Zal ik hier nog een soort conclusie maken van \gls{MTASK}.}
+
 \subsection{Other \texorpdfstring{\glsxtrshort{TOP}}{TOP} languages}
 While \gls{ITASK} conceived \gls{TOP}, it is not the only \gls{TOP} system.
 Some \gls{TOP} systems arose from Master's and Bachelor's thesis projects.
@@ -304,73 +312,66 @@ For example, \textmu{}Task \citep{piers_task-oriented_2016}, a \gls{TOP} languag
 Some \gls{TOP} languages were created to solve a practical problem.Toppyt \citep{lijnse_toppyt_2022} is a general purpose \gls{TOP} language written in \gls{PYTHON} used to host frameworks for modelling C2 systems, and hTask \citep{lubbers_htask_2022}, a vessel for experimenting with asynchronous \glspl{SDS}.
 Finally there are \gls{TOP} languages with strong academic foundations.
 \Gls{TOPHAT} is a fully formally specified \gls{TOP} language designed to capture the essence of \gls{TOP} formally \citep{steenvoorden_tophat_2019}.
-Such a formal specification allows for symbolic execution, hint generation, but also the translation to \gls{ITASK} for actually performing the work\citep[\citesection{G.3}]{steenvoorden_tophat_2022}.
+Such a formal specification allows for symbolic execution, hint generation, but also the translation to \gls{ITASK} for actually performing the work \citep{steenvoorden_tophat_2022}.
 
-\section{Contributions}\label{sec:contributions}
-This section provides a thorough overview of the relation to publications and the scientific contributions of the episodes and chapters.
+\section{Contributions}%
+\label{sec:contributions}
+\todo{Dit heb ik sterk ingekort. Ok\'e?}
+This section provides a thorough overview of the relation between the scientific publications and the episodes and chapters.
 
 \subsection{\Fullref{prt:dsl}}
 The \gls{MTASK} system is a heterogeneous \gls{EDSL} and during the development of it, several novel basal techniques for embedding \glspl{DSL} in \gls{FP} languages have been found.
-This episode is a paper based episodes on these techniques.
+This episode is paper based.
 
 \Cref{chp:classy_deep_embedding} is based on the paper \emph{Deep Embedding with Class} \citep{lubbers_deep_2022}.
-While supervising \citeauthor{amazonas_cabral_de_andrade_developing_2018}'s \citeyear{amazonas_cabral_de_andrade_developing_2018} Master's thesis, focussing on an early version of \gls{MTASK}, a seed was planted for a novel deep embedding technique for \glspl{DSL} where the resulting language is extendible both in constructs and in interpretation using type classes and existential data types.
-Slowly the ideas organically grew to form the technique shown in the paper.
-The related work section is updated with the research found only after publication.
+It shows a novel deep embedding technique for \glspl{DSL} where the resulting language is extendible both in constructs and in interpretation just using type classes and existential data types\footnotemark.
+\footnotetext{%
+The related work section is updated with the research found after publication.
 \Cref{sec:classy_reprise} was added after publication and contains a (yet) unpublished extension of the embedding technique for reducing the required boilerplate at the cost of requiring some advanced type system extensions.
+}
 
 \Cref{chp:first-class_datatypes} is based on the paper \emph{First-Class Data Types in Shallow Embedded Domain-Specific Languages} \citep{lubbers_first-class_2022}.
 It shows how to inherit data types from the host language in \glspl{EDSL} using metaprogramming by providing a proof-of-concept implementation using \gls{HASKELL}'s metaprogramming system: \glsxtrlong{TH}.
-Besides showing the result, the paper also serves as a gentle introduction to using \glsxtrlong{TH} and contains a thorough literature study on research that uses \glsxtrlong{TH}.
+Besides showing the result, the paper also serves as a gentle introduction to, and contains a thorough literature study on \glsxtrlong{TH}.
 %The research in this paper and writing the paper was performed by me, though there were weekly meetings with Pieter Koopman and Rinus Plasmeijer in which we discussed and refined the ideas.
 
-\subsection{\nameref{prt:top}}
-This is a monograph compiled from the following papers and revised lecture notes on \gls{MTASK}.
-It provides a gentle introduction to all aspects of the \gls{MTASK} system and \gls{TOP} for the \gls{IOT}.
+\subsection{\Fullref{prt:top}}
+There were many papers and revised lecture notes published on the design, implementation and usage of \gls{MTASK}.
+This episode is a monograph compiled from the following publications and shows all aspects of the \gls{MTASK} system and \gls{TOP} for the \gls{IOT}.
+\todo{Hier een over\-zicht van de chapters geven?}
 
 \begin{itemize}
        \item \emph{A Task-Based \glsxtrshort{DSL} for Microcomputers} \citep{koopman_task-based_2018}.
                This is the initial \gls{TOP}\slash{}\gls{MTASK} paper.
                It provides an overview of the initial \gls{TOP} \gls{MTASK} language and shows first versions of some of the interpretations.
-       \item \emph{Task Oriented Programming for the \glsxtrlong{IOT}} \citep{lubbers_task_2018}.
-               
-               This paper was an extension of my Master's thesis \citep{lubbers_task_2017}.
+       \item \emph{Task Oriented Programming for the Internet of Things} \citep{lubbers_task_2018}\footnotetext{This work is an extension of my Master's thesis \citep{lubbers_task_2017}.}.
                It shows how a simple imperative variant of \gls{MTASK} was integrated with \gls{ITASK}.
                While the language was a lot different from later versions, the integration mechanism is still used in \gls{MTASK} today.
 %              \paragraph{Contribution}
 %              The research in this paper and writing the paper was performed by me, though there were weekly meetings with Pieter Koopman and Rinus Plasmeijer in which we discussed and refined the ideas.
-       \item \emph{Multitasking on Microcontrollers using Task Oriented Programming} \citep{lubbers_multitasking_2019}\footnote{%
-               This work acknowledges the support of the ERASMUS+ project ``Focusing Education on Composability, Comprehensibility and Correctness of Working Software'', no. 2017--1--SK01--KA203--035402
-               }.
-
-               This paper is a short paper on the multitasking capabilities of \gls{MTASK} comparing it to traditional multitasking methods for \gls{ARDUINO}.
+       \item \emph{Multitasking on Microcontrollers using Task Oriented Programming} \citep{lubbers_multitasking_2019}\footnote{This work acknowledges the support of the \erasmusplus{} project ``Focusing Education on Composability, Comprehensibility and Correctness of Working Software'', no.\ 2017--1--SK01--KA203--035402.}.
+               This is a short paper on the multitasking capabilities of \gls{MTASK} comparing it to traditional multitasking methods for \gls{ARDUINO}.
 %              \paragraph{Contribution}
 %              The research in this paper and writing the paper was performed by me, though there were weekly meetings with Pieter Koopman and Rinus Plasmeijer.
        \item \emph{Simulation of a Task-Based Embedded Domain Specific Language for the Internet of Things} \citep{koopman_simulation_2018}\footnotemark[\value{footnote}].
-
                These revised lecture notes are from a course on the \gls{MTASK} simulator was provided at the 2018 \gls{CEFP}\slash{}\gls{3COWS} winter school in Ko\v{s}ice, Slovakia.
 %              \paragraph{Contribution}
 %              Pieter Koopman wrote and taught it, I helped with the software and research.
        \item \emph{Writing Internet of Things Applications with Task Oriented Programming} \citep{lubbers_writing_2019}\footnotemark[\value{footnote}].
-
-               These revised lecture notes are from a course on programming in \gls{IOT} systems using \gls{MTASK} provided at the 2019 \gls{CEFP}\slash{}\gls{3COWS} summer school in Budapest, Hungary.
+               These revised lecture notes are from a course on programming \gls{IOT} systems using \gls{MTASK} provided at the 2019 \gls{CEFP}\slash{}\gls{3COWS} summer school in Budapest, Hungary.
 %              \paragraph{Contribution}
 %              Pieter Koopman prepared and taught half of the lecture and supervised the practical session.
 %              I taught the other half of the lecture, wrote the lecture notes, made the assignments and supervised the practical session.
        \item \emph{Interpreting Task Oriented Programs on Tiny Computers} \citep{lubbers_interpreting_2019}.
-
-               This paper shows an implementation for \gls{MTASK} for microcontrollers.
+               This paper shows an implementation of the byte code compiler and \gls{RTS} of \gls{MTASK}.
 %              \paragraph{Contribution}
 %              The research in this paper and writing the paper was performed by me, though there were weekly meetings with Pieter Koopman and Rinus Plasmeijer.
        \item \emph{Reducing the Power Consumption of IoT with Task-Oriented Programming} \citep{crooijmans_reducing_2022}.
-
                This paper shows how to create a scheduler so that devices running \gls{MTASK} tasks can go to sleep more automatically and how interrupts are incorporated in the language.
 %              \paragraph{Contribution}
 %              The research was carried out by \citet{crooijmans_reducing_2021} during his Master's thesis.
 %              I did the daily supervision and helped with the research, Pieter Koopman was the formal supervisor and wrote most of the paper.
-       \item \emph{Green Computing for the Internet of Things} \citep{lubbers_green_2022}\footnote{
-               This work acknowledges the support of the Erasmus+ project ``SusTrainable---Promoting Sustainability as a Fundamental Driver in Software Development Training and Education'', no. 2020--1--PT01--KA203--078646}.
-
+       \item \emph{Green Computing for the Internet of Things} \citep{lubbers_green_2022}\footnote{This work acknowledges the support of the \erasmusplus{} project ``SusTrainable---Promoting Sustainability as a Fundamental Driver in Software Development Training and Education'', no.\ 2020--1--PT01--KA203--078646.}.
                These revised lecture notes are from a course on sustainable \gls{IOT} programming with \gls{MTASK} provided at the 2022 SusTrainable summer school in Rijeka, Croatia.
 
 %              \paragraph{Contribution}
@@ -380,21 +381,20 @@ It provides a gentle introduction to all aspects of the \gls{MTASK} system and \
 \end{itemize}
 
 \paragraph{Contribution:}
-The original imperative predecessors the \gls{MTASK} language and their initial interpretations were developed by Pieter Koopman and Rinus Plasmeijer.
+The original imperative predecessors of the \gls{MTASK} language and their initial interpretations were developed by Pieter Koopman and Rinus Plasmeijer.
 I continued with the language; developed the byte code interpreter, the precursor to the \gls{C} code generation interpretation; the integration with \gls{ITASK}; and the \gls{RTS}.
 The paper of which I am first author are solely written by me.
 
 \subsection{\nameref{prt:tvt}}
 \Cref{prt:tvt} is based on a journal paper that quantitatively and qualitatively compares traditional \gls{IOT} architectures with \gls{IOT} systems using \gls{TOP} and contains a single chapter.
 This chapter is based on the journal paper: \emph{Could Tierless Programming Reduce IoT Development Grief?} \citep{lubbers_could_2022}\footnote{This work is an extension of the conference article: \emph{Tiered versus Tierless IoT Stacks: Comparing Smart Campus Software Architectures} \citep{lubbers_tiered_2020}\footnotemark.}.
-\footnotetext{This paper was partly funded by the 2019 Radboud-Glasgow Collaboration Fund.}
-
+\footnotetext{This work was partly funded by the 2019 Radboud-Glasgow Collaboration Fund.}
 It compares programming traditional tiered architectures to tierless architectures by showing a qualitative and a quantitative four-way comparison of a smart-campus application.
 
 \paragraph{Contribution:}
 Writing the paper was performed by all authors.
-I created the server application, the \gls{CLEAN}\slash{}\gls{ITASK}\slash{}\gls{MTASK} implementation (\glsxtrshort{CWS}) and the \gls{CLEAN}\slash{}\gls{ITASK} implementation (\glsxtrshort{CRS})
-Adrian Ramsingh created the \gls{MICROPYTHON} implementation (\glsxtrshort{PWS}), the original \gls{PYTHON} implementation (\glsxtrshort{PRS}) and the server application were created by \citet{hentschel_supersensors:_2016}.
+I created the server application, the \gls{CLEAN}\slash{}\gls{ITASK}\slash{}\gls{MTASK} implementation (\glsxtrshort{CWS}), and the \gls{CLEAN}\slash{}\gls{ITASK} implementation (\glsxtrshort{CRS});
+Adrian Ramsingh created the \gls{MICROPYTHON} implementation (\glsxtrshort{PWS}); the original \gls{PYTHON} implementation (\glsxtrshort{PRS}), and the server application were created by \citet{hentschel_supersensors:_2016}.
 
 \input{subfilepostamble}
 \end{document}
index 5e7d265..34be611 100644 (file)
@@ -20,8 +20,6 @@
 \DeclareSIUnit\celcius{{}^{\circ}\kern-\scriptspace\mathsf{C}}
 \everymath{\it\/}
 \DeclareMathSymbol{\shortminus}{\mathbin}{AMSa}{"39} %chktex 18
-\newcommand{\dcolon}[0]{\mathbin{::}}
-\newcommand{\refreshrate}[2]{\langle{}#1, #2\rangle{}}
 
 % Internationalisation
 \usepackage[dutch,russian,british]{babel}
 \def\part@nostar@nopt#1{\NR@gettitle{#1}\titlesec@part{#1}}
 \def\part@nostar@opt[#1]#2{\NR@gettitle{#1}\titlesec@part[#1]{#2}}
 \makeatother
-\newenvironment{chapterabstract}{\begin{quotation}\em\noindent}{\end{quotation}} %chktex 6
+\newenvironment{chapterabstract}{\begin{quotation}\em}{\end{quotation}} %chktex 6
 
 % Increase the depth for the table of contents
 \setcounter{secnumdepth}{3}
 
 % Custom commands
 \newcommand{\GHCmod}[1]{\texttt{#1}}
-\newcommand{\requiresGHCmod}[2][]{\footnote{Requires \GHCmod{#2} to be enabled. #1}}
-%\newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&c}}}
+\newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)}
+\newcommand{\dcolon}[0]{\mathbin{::}}
+\newcommand{\doifmt}[1]{\href{https://doi.org/#1}{#1}}
 \newcommand{\etc}{{\fontfamily{cmr}\selectfont{\itshape\/\&\kern-0.2em c}}}
-\newcommand{\rdmentry}[5]{#1 (#2): #3. #4.\ \href{https://doi.org/#5}{#5}}
+\newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)}
 \newcommand{\mlubbers}{Lubbers, M.\ (Radboud University)}
 \newcommand{\pkoopman}{Koopman, dr.\ P.\ (Radboud University)}
-\newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
-\newcommand{\aramsingh}{Ramsingh, A.\ (University of Glasgow)}
-\newcommand{\jsinger}{Singer, dr.\ J.\ (University of Glasgow)}
 \newcommand{\ptrinder}{Trinder, prof.~dr.\ P.\ (University of Glasgow)}
-
-\newcommand{\mypart}[3]{
-       \part[#2: #3]{#2\\[2ex]\smaller{}#3}%
-       \label{#1}
-}
+\newcommand{\rdmentry}[5]{#1 (#2): #3. #4.\ \doifmt{#5}}
+\newcommand{\refreshrate}[2]{\langle{}#1, #2\rangle{}}
+\newcommand{\requiresGHCmod}[2][]{\footnote{Requires \GHCmod{#2} to be enabled. #1}}
+\newcommand{\rplasmeijer}{Plasmeijer, prof.\ dr.\ ir.\ R.\ (Radboud University)}
+\newcommand{\erasmusplus}{ERASMUS\raisebox{.25ex}{+}}
index d0aad76..9e2e61b 100644 (file)
@@ -1,6 +1,7 @@
 \ifSubfilesClassLoaded{%
        \bibliography{../other,../self,../tiot}
-       \printglossaries%
+       \printglossary[style=mcolindex]%
+       \printglossary[type=\acronymtype,style=mcolindex]%
 }{
 
 }
index 86dc50e..18de889 100644 (file)
@@ -15,7 +15,7 @@
 \setuptodonotes{
        backgroundcolor=white,
        linecolor=black,
-       size=tiny,
+%      size=tiny,
 }
 
 % Document info
 
 % Introduction
 \subfile{intro/intro}
-% DSL
 
 \part[\'Etude --- Domain-Specific Languages]{\'Etude\\[2ex]\smaller{}Domain-Specific Languages}%
 \label{prt:dsl}
-\subfile{dsl/class}  % Deep embedding with class
-\subfile{dsl/first} % First-class data types
+\subfile{dsl/class}    % Deep embedding with class
+\subfile{dsl/first}    % First-class data types
 
-\part[Oratorio --- Task-Oriented Programming]{Oratorio\\[2ex]\smaller{}Task-Oriented Programming for the Internet of Things}%
+\part[Oratorio --- Task-Oriented Programming for the Internet of Things]{Oratorio\\[2ex]\smaller{}Task-Oriented Programming for the Internet of Things}%
 \label{prt:top}
-%\chapter{\texorpdfstring{\Glsxtrshort{TOP} for the \glsxtrshort{IOT}}{TOP for the IoT}}%
-\subfile{top/4iot}
-
-%\chapter{The \texorpdfstring{\gls{MTASK}}{mTask} \texorpdfstring{\glsxtrshort{DSL}}{DSL}}%
-\subfile{top/lang}
-
-%\chapter{Integration with \texorpdfstring{\gls{ITASK}}{iTask}}%
-\subfile{top/int}
-
-%\chapter{Implementation}%
-\subfile{top/imp}
-
-% Green computing
-\subfile{top/green}
+\subfile{top/4iot}  % TOP for the IoT
+\subfile{top/lang}  % mTask DSL
+\subfile{top/int}   % Integration with iTask
+\subfile{top/imp}   % Implementation
+\subfile{top/green} % Green computing
 
 \part[Variations --- Tiered vs.\ Tierless Programming]{Transformation\\[2ex]\smaller{}Tiered vs.\ Tierless Programming}%
 \label{prt:tvt}
-\subfile{tvt/tvt} % Could Tierless Languages Reduce IoT Development Grief?
+\subfile{tvt/tvt}   % Could Tierless Languages Reduce IoT Development Grief?
 
+% Conclusion
 \bookmarksetup{startatroot} % descend back out of the previous part
 \addtocontents{toc}{\bigskip}% Insert some whitespace to make the TOC better
-\subfile{concl/conclusion}
+\subfile{concl/concl}
 
 % Start appendix
 \appendix%
 \label{chp:appendix}
 \addcontentsline{toc}{part}{Appendix}
 
-\subfile{appx/clean_for_haskell_programmers}
+\subfile{appx/c4hp}
 \subfile{appx/mtask_aux}
 \subfile{appx/bytecode}
 
index 095b276..dc6b6dc 100644 (file)
@@ -5,10 +5,10 @@
 \begin{document}
 \input{subfileprefix}
 
-\chapter{\texorpdfstring{\Glsxtrshort{TOP} for the \glsxtrshort{IOT}}{TOP for the IoT}}%
+\chapter{\texorpdfstring{\Glsxtrlong{TOP} for the \glsxtrlong{IOT}}{Task-oriented programming for the internet of things}}%
 \label{chp:top4iot}
 \begin{chapterabstract}
-       This chapter:
+       \noindent This chapter:
        \begin{itemize}
                \item introduces the problems with \gls{TOP} for the \gls{IOT}.
                \item shows how to create the \emph{Hello World!} application for microcontrollers using \gls{ARDUINO};
@@ -38,6 +38,7 @@ The programs are usually cyclic executives instead of tasks running in an operat
                Storage & \qty{1}{\tebi\byte} & \qty{32}{\kibi\byte} & \qtyrange{0.5}{4}{\mebi\byte}\\
                \gls{RAM} & \qtyrange{4}{16}{\gibi\byte} & \qty{2}{\kibi\byte} & \qty{160}{\kibi\byte}\\
                Power & \qtyrange{50}{100}{\watt} & \qtyrange{0.13}{250}{\milli\watt} & \qtyrange{0.1}{350}{\milli\watt}\\
+               Size & $\pm$\qty{1060}{\cubic\cm} & $\pm$\qty{7.5}{\cubic\cm} & $\pm$\qty{1.1}{\cubic\cm}\\
                Price & \euro{1500} & \euro{3} & \euro{4}\\
                \bottomrule
        \end{tabular}
@@ -48,7 +49,7 @@ The popular \gls{ARDUINO} \gls{C}\slash\gls{CPP} dialect and accompanying librar
 Originally it was designed for the in-house developed open-source hardware with the same name but the setup allows porting to many architectures.
 It provides an \gls{IDE} and toolchain automation to perform all steps of the toolchain with a single command.
 
-\section{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}
+\subsection{\texorpdfstring{\Glsxtrshort{TOP} for the \glsxtrshort{IOT}}{TOP for the IoT}}
 \Gls{TOP} is a programming paradigm that allows multi-tier systems to be generated from a single declarative source.
 \Gls{ITASK} is a general-purpose \gls{TOP} system for programming distributed web applications.
 These distributed web applications often form the core of \gls{IOT} applications as well but integrating these devices in \gls{ITASK} is not straightforward.
@@ -108,7 +109,7 @@ blink =
        \end{subfigure}
 \end{figure}
 
-\section{Threaded blinking}
+\section{Multi tasking}
 Now say that we want to blink multiple blinking patterns on different \glspl{LED} concurrently.
 For example, blink three \glspl{LED} connected to \gls{GPIO} pins $1,2$ and $3$ at intervals of \qtylist{500;300;800}{\ms}.
 Intuitively you want to lift the blinking behaviour to a function and call this function three times with different parameters as done in \cref{lst:blinkthreadno}
@@ -161,7 +162,7 @@ void loop() {
 This method is very error prone, requires a lot of pointer juggling and generally results into spaghetti code.
 Furthermore, it is very difficult to represent dependencies between threads, often state machines have to be explicitly programmed by hand to achieve this.
 
-\section{Threaded blinking in \texorpdfstring{\gls{MTASK}}{mTask}}
+\subsection{Multi tasking in \texorpdfstring{\gls{MTASK}}{mTask}}
 The \cleaninline{delay} \emph{task} does not block the execution but \emph{just} emits no value when the target waiting time has not yet passed and emits a stable value when the time is met.
 In contrast, the \arduinoinline{delay()} \emph{function} on the \gls{ARDUINO} is blocking which prohibits interleaving.
 To make code reuse possible and make the implementation more intuitive, the blinking behaviour is lifted to a recursive function instead of using the imperative \cleaninline{rpeat} construct.
@@ -190,7 +191,11 @@ blinktask =
 % VimTeX: SynIgnore off
 
 \section{Conclusion}
-\todo[inline]{write}
+The edge layer of \gls{IOT} systems are powered by microcontrollers.
+Programming them happens through compiled firmwares using low-level imperative programming languages and do usually not come with an \gls{OS}.
+Consequently, writing applications that perform multiple tasks at the same time is error prone, and complex; and requires a lot of boilerplate and manual scheduling code.
+With the \gls{MTASK} system, a \gls{TOP} programming language for \gls{IOT} edge devices, this limitation can be overcome.
+\todo{uit\-breiden}
 
 \begin{subappendices}
 \section{History of \texorpdfstring{\gls{MTASK}}{mTask}}
index 30e74a2..33f7813 100644 (file)
@@ -128,34 +128,43 @@ class liftsds v where
 \end{lstClean}
 
 The compilation of the code and the serialisation of the data throws away all typing information.
-\Cref{lst:mtask_itasksds_lens} shows a pseudocode implementation of \cleaninline{liftsds}.
 \Glspl{SDS} are stored in the compiler state as a map from identifiers to either an initial value or an \cleaninline{MTLens}.
 The \cleaninline{MTLens} is a type synonym for a \gls{SDS} that represents the typeless serialised value of the underlying \gls{SDS}.
+This is done so that the \cleaninline{withDevice} task can write the received \gls{SDS} updates to the according \gls{SDS} independently.
+\Gls{ITASK}'s notification mechanism then takes care of the rest.
 Such a \gls{SDS} is created by using the \cleaninline{mapReadWriteError} which, given a pair of read and write functions with error handling, produces a \gls{SDS} with the lens embedded.
 The read function transforms, the function that converts a typed value to a typeless serialised value, just applies the serialisation.
-The write function, the function that, given the new serialised value and the old typed value, produces a new typed value tries do deserialise the value.
-
-First, in similar fashion to how functions are implemented, using fixed points, the \glspl{SDS} is 
+The write function, the function that, given the new serialised value and the old typed value, produces a new typed value.
+It tries to decode the serialised value, if that succeeds, it is written to the underlying \gls{SDS}, an error is thrown otherwise.
+\Cref{lst:mtask_itasksds_lens} provides the implementation for this:
 
 % VimTeX: SynIgnore on
 \begin{lstClean}[label={lst:mtask_itasksds_lens},caption={Lens applied to lifted \gls{ITASK} \glspl{SDS} in \gls{MTASK}.}]
-instance liftsds BCInterpret where
+lens :: (Shared sds a) -> MTLens | type a & RWShared sds
+lens sds = mapReadWriteError
+       ( \r->Ok (fromString (toByteCode{|*|} r)
+       , \w r-> ?Just <$> iTasksDecode (toString w)
+       ) ?None sds
+\end{lstClean}
+% VimTeX: SynIgnore off
+
+\Cref{lst:mtask_itasksds_lift} shows the code for the implementation of \cleaninline{liftsds} that uses the \cleaninline{lens} function shown earlier.
+First, the \gls{SDS} to be lifted is extracted from the expression by bootstrapping the fixed point with a dummy value.
+This is safe because the expression on the right-hand side of the \cleaninline{In} is never used.
+Then, using \cleaninline{addSdsIfNotExist}, the identifier for this particular \gls{SDS} is either retrieved from the compiler state or generated freshly.
+This identifier is then used to provide a reference to the \cleaninline{def} definition to evaluate the main expression.
+
+% VimTeX: SynIgnore on
+\begin{lstClean}[label={lst:mtask_itasksds_lift},caption={Lens applied to lifted \gls{ITASK} \glspl{SDS} in \gls{MTASK}.}]
        liftsds def = {main =
-                       let (t In e) = def (abort "liftsds: expression too strict")
+                       let (t In _) = def (abort "liftsds: expression too strict")
                        in addSdsIfNotExist (Right $ lens t)
-                               >>= \sdsi-> let (t In e) = def (pure (Sds sdsi))
-                                       in e.main
+                               >>= \sdsi->let (_ In e) = def (pure (Sds sdsi)) in e.main
                }
        where
-               lens :: ((Shared sds a) -> MTLens) | type, iTask a & RWShared sds
-               lens = mapReadWriteError
-               ( \r->Ok (fromString (toByteCode{|*|} r)
-                       , \w r-> ?Just <$> iTasksDecode (toString w)
-                       ) ?None
 \end{lstClean}
 % VimTeX: SynIgnore off
 
-
 \section{Conclusion}
 
 
index 2baed8b..1e1b02c 100644 (file)
@@ -5,18 +5,13 @@
 \begin{document}
 \input{subfileprefix}
 
-\chapter{The \texorpdfstring{\gls{MTASK}}{mTask} \texorpdfstring{\glsxtrshort{DSL}}{DSL}}%
+\chapter{The \texorpdfstring{\gls{MTASK}}{mTask} language}%\texorpdfstring{\glsxtrshort{DSL}}{DSL}}%
 \label{chp:mtask_dsl}
 \begin{chapterabstract}
-This chapter introduces the \gls{MTASK} language more technically by:
+       \noindent This chapter introduces the \gls{TOP} language \gls{MTASK} language by:
        \begin{itemize}
                \item introducing the setup of the \gls{EDSL};
-               \item and showing the language interface and examples for:
-                       \begin{itemize}
-                               \item data types
-                               \item expression
-                               \item task and their combinators.
-                       \end{itemize}
+               \item and showing the language interface and examples for the type system, data types, expressions, tasks and their combinators.
        \end{itemize}
 \end{chapterabstract}
 
@@ -34,8 +29,8 @@ The following interpretations are available for \gls{MTASK}.
                The simulator converts the expression to a ready-for-work \gls{ITASK} simulation in which the user can inspect and control the simulated peripherals and see the internal state of the tasks.
        \item[Byte code compiler]
 
-               The compiler compiles the \gls{MTASK} program at runtime to a specialised byte code.
-               Using a handful of integration functions and tasks, \gls{MTASK} tasks can be executed on microcontrollers and integrated in \gls{ITASK} as if they were regular \gls{ITASK} tasks.
+               The compiler compiles the \gls{MTASK} program to a specialised byte code.
+               Using a handful of integration functions and tasks (see \cref{chp:integration_with_itask}), \gls{MTASK} tasks can be executed on microcontrollers and integrated in \gls{ITASK} as if they were regular \gls{ITASK} tasks.
                Furthermore, with special language constructs, \glspl{SDS} can be shared between \gls{MTASK} and \gls{ITASK} programs.
 \end{description}
 
@@ -79,7 +74,6 @@ class type t | iTask, ... ,fromByteCode, toByteCode t
 class basicType t | type t where ...
 
 class mtask v | expr, ..., int, real, long v
-
 \end{lstClean}
 
 Sensors, \glspl{SDS}, functions, \etc{} may only be defined at the top level.
@@ -95,14 +89,15 @@ someTask :: MTask v Int | mtask v & liftsds v & sensor1 v & ...
 someTask =
        sensor1 config1 \sns1->
        sensor2 config2 \sns2->
-          sds \s1=initial
-       In liftsds \s2=someiTaskSDS
-       In fun \fun1= ( ... )
-       In fun \fun2= ( ... )
+          sds     \s1  = initialValue
+       In liftsds \s2  = someiTaskSDS
+       In fun     \fun1= ( ... )
+       In fun     \fun2= ( ... )
        In { main = mainexpr }
 \end{lstClean}
 
 \section{Expressions}\label{sec:expressions}
+This section shows all \gls{MTASK} constructs for exppressions.
 \Cref{lst:expressions} shows the \cleaninline{expr} class containing the functionality to lift values from the host language to the \gls{MTASK} language (\cleaninline{lit}); perform number and boolean arithmetics; do comparisons; and conditional execution.
 For every common boolean and arithmetic operator in the host language, an \gls{MTASK} variant is present, suffixed by a period to not clash with \gls{CLEAN}'s builtin operators.
 
@@ -149,7 +144,7 @@ e2 = if' (e0 ==. int e1)
 
 \Gls{MTASK} is shallowly embedded in \gls{CLEAN} and the terms are constructed at runtime.
 This means that \gls{MTASK} programs can also be tailor-made at runtime or constructed using \gls{CLEAN} functions maximising the linguistic reuse \citep{krishnamurthi_linguistic_2001}
-\cleaninline{approxEqual} in \cref{lst:example_macro} performs an approximate equality---albeit not taking into account all floating point pecularities---.
+\cleaninline{approxEqual} in \cref{lst:example_macro} performs a simple approximate equality---albeit without taking into account all floating point pecularities.
 When calling \cleaninline{approxEqual} in an \gls{MTASK} function, the resulting code is inlined.
 
 \begin{lstClean}[label={lst:example_macro},caption={Example linguistic reuse in the \gls{MTASK} language.}]
@@ -162,7 +157,7 @@ approxEqual x y eps = if' (x ==. y) true
 \end{lstClean}
 
 \subsection{Data types}
-Most of \gls{CLEAN}'s basic types have been mapped on \gls{MTASK} types.
+Most of \gls{CLEAN}'s fixed-size basic types are mapped on \gls{MTASK} types.
 However, it can be useful to have access to compound types as well.
 All types in \gls{MTASK} must have a fixed size representation on the stack so sum types are not (yet) supported.
 While it is possible to lift types using the \cleaninline{lit} function, you cannot do anything with the types besides passing them around but they are being produced by some parallel task combinators (see \cref{sssec:combinators_parallel}).
@@ -239,6 +234,7 @@ swapTuple =
 % VimTeX: SynIgnore off
 
 \section{Tasks and task combinators}\label{sec:top}
+This section describes \gls{MTASK}'s task language.
 \Gls{MTASK}'s task language can be divided into three categories, namely
 \begin{enumerate*}
        \item Basic tasks, in most \gls{TOP} systems, the basic tasks are called editors, modelling the interactivity with the user.
@@ -249,10 +245,12 @@ swapTuple =
 \end{enumerate*}
 
 As \gls{MTASK} is integrated with \gls{ITASK}, the same stability distinction is made for task values.
-A task in \gls{MTASK} is denoted by the \gls{DSL} type synonym shown in \cref{lst:task_type}.
+A task in \gls{MTASK} is denoted by the \gls{DSL} type synonym shown in \cref{lst:task_type}, an expression of the type \cleaninline{TaskValue a} in interpretation \cleaninline{v}.
 
 \begin{lstClean}[label={lst:task_type},caption={Task type in \gls{MTASK}.}]
 :: MTask v a :== v (TaskValue a)
+
+// From the iTask library
 :: TaskValue a
        = NoValue
        | Value a Bool
@@ -275,7 +273,6 @@ class delay v :: (v n) -> MTask v n | long v n
 \subsubsection{Peripherals}\label{sssec:peripherals}
 For every sensor or actuator, basic tasks are available that allow interaction with the specific peripheral.
 The type classes for these tasks are not included in the \cleaninline{mtask} class collection as not all devices nor all language interpretations have such peripherals connected.
-%\todo{Historically, peripheral support has been added \emph{by need}.}
 
 \Cref{lst:dht,lst:gpio} show the type classes for \glspl{DHT} sensors and \gls{GPIO} access.
 Other peripherals have similar interfaces, they are available in the \cref{sec:aux_peripherals}.
@@ -341,7 +338,7 @@ task2 = declarePin D3 PMOutput \d3->{main=writeD d3 true}
 \end{lstClean}
 
 \subsection{Task combinators}
-Task combinators are used to combine multiple tasks into one to describe workflows.
+Task combinators are used to combine multiple tasks to describe workflows.
 There are three main types of task combinators, namely:
 \begin{enumerate*}
        \item Sequential combinators that execute tasks one after the other, possibly using the result of the left hand side.
@@ -373,8 +370,6 @@ class step v | expr v where
        | Always                                (MTask v u)
 \end{lstClean}
 
-\todo{more examples step?}
-
 The following listing shows an example of a step in action.
 The \cleaninline{readPinBin} function produces an \gls{MTASK} task that classifies the value of an analogue pin into four bins.
 It also shows that the nature of embedding allows the host language to be used as a macro language.
@@ -405,8 +400,8 @@ The semantics are easily described using \gls{CLEAN} functions shown in \cref{ls
                \begin{lstClean}[caption={Semantics of the\\conjunction combinator.},label={lst:semantics_con}]
 con :: (TaskValue a) (TaskValue b)
        -> TaskValue (a, b)
-con NoValue r       = NoValue
-con l       NoValue = NoValue
+con NoValue r = NoValue
+con l NoValue = NoValue
 con (Value l ls) (Value r rs)
        = Value (l, r) (ls && rs)
 
@@ -416,8 +411,8 @@ con (Value l ls) (Value r rs)
                \begin{lstClean}[caption={Semantics of the\\disjunction combinator.},label={lst:semantics_dis}]
 dis :: (TaskValue a) (TaskValue a)
        -> TaskValue a
-dis NoValue r       = r
-dis l       NoValue = l
+dis NoValue r = r
+dis l NoValue = l
 dis (Value l ls) (Value r rs)
        | rs        = Value r True
        | otherwise = Value l ls