restructure
[phd-thesis.git] / intro / intro.tex
index 608cb8a..be52195 100644 (file)
        \begin{itemize}
                \item introduces the topic and research ventures of this dissertation;
                \item shows a reading guide;
-               \item provides background material on \glsxtrlong{IOT}, \glsxtrlongpl{DSL}, \glsxtrlong{TOP}, and the \gls{TOP} languages \gls{ITASK} and \gls{MTASK} in particular;
+               \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}
 \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 all computers to some degree and for this reason require software to operate.
+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.
 
 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
-Microcontrollers contain integrated circuits accommodating a microprocessor designed for use in embedded applications.
-Typical microprocessors therefore are 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.
+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.
 %
 %\begin{figure}[ht]
 %      \centering
@@ -31,31 +31,31 @@ Typical microprocessors therefore are tiny in size; have little memory; contain
 %      \label{fig:esp_prototype}
 %\end{figure}
 
-Edge devices come in numerous types, differing substantially from the other devices in the system.
 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 introduces research on taming these complex \gls{IOT} systems using \gls{TOP}.
+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-tier applications is automatically generated.
+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.
 Unfortunately, because the abstraction level is so high, the hardware requirements are too excessive for a general purpose \gls{TOP} system to be suitable for the average edge device.
 
 This is where \glspl{DSL} are brought into play.
 \Glspl{DSL} are programming languages created with a specific domain in mind.
-Consequently, domain 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.
+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.
 
 Using \gls{MTASK}, a novel domain-specific \gls{TOP} \gls{DSL} fully integrated with \gls{ITASK}, all layers of the \gls{IOT} can be orchestrated from a single source.
+\todo[inline]{uitbreiden}
 
 \section{Reading guide}
-The thesis is presented as a purely functional rhapsody.
+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{%
        A \emph{rhapsody} in music is a one-movement work that is episodic yet integrated, free-flowing in structure, featuring a range of highly contrasted moods, colour, and tonality.}
 \end{quote}
-The three episodes are barded by the introduction and conclusion (\cref{chp:introduction,chp:conclusion}).
-\Cref{prt:dsl} is a paper-based---otherwise known as cumulative---episode providing insight in advanced \gls{DSL} embedding techniques for \glspl{FP}.
+The three episodes in this thesis are barded by the introduction and conclusion (\cref{chp:introduction,chp:conclusion}).
+\Cref{prt:dsl} is a paper-based---otherwise known as cumulative---episode providing insights in advanced \gls{DSL} embedding techniques for \gls{FP} languages.
 The chapters are readable independently.
 \Cref{prt:top} is a monograph showing \gls{MTASK}, a \gls{TOP} \gls{DSL} for the \gls{IOT}.
 Hence, the chapters are best read in order.
@@ -64,7 +64,7 @@ The chapter is readable independently.
 
 The following sections provide background material on the \gls{IOT}, \glspl{DSL}, and \gls{TOP} after which a detailed overview of the contributions is presented.
 Text typeset as \texttt{teletype} represents source code.
-Standalone source code listings are used are marked by the programming language used.
+Standalone source code listings are marked by the programming language used.
 Specifically for the \gls{FP} language \gls{CLEAN}, a guide tailored to \gls{HASKELL} programmers is available in \cref{chp:clean_for_haskell_programmers}.
 
 \section{\texorpdfstring{\Glsxtrlong{IOT}}{Internet of things}}\label{sec:back_iot}
@@ -79,35 +79,35 @@ CISCO states that the \gls{IOT} started when there where as many connected devic
 Today, \gls{IOT} is the term for a system of devices that sense the environment, act upon it and communicate with each other and the world.
 These connected devices are already in households all around us in the form of smart electricity meters, fridges, phones, watches, home automation, \etc.
 
-When describing \gls{IOT} systems, a tiered---or layered---architecture is often used to compartmentalize the technology.
-The number of tiers heavily depends on the required complexity of the model but for the intents and purposes of this thesis, the four layer architecture as shown in \cref{fig:iot-layers} is used.
+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]
        \centering
        \includestandalone{iot-layers}
-       \caption{A four-tier \gls{IOT} architecture.}%
+       \caption{A layered \gls{IOT} architecture.}%
        \label{fig:iot-layers}
 \end{figure}
 
 To explain the tiers, an example \gls{IOT} application---home automation---is dissected accordingly.
 Closest to the end-user is the presentation layer, it provides the interface between the user and the \gls{IOT} system.
-In home automation this may be a web interface or an app used on a phone or mounted tablet to interact with the edge devices and view the sensor data.
+In home automation this may be a web interface or an app used on a phone or wall-mounted tablet to interact with the edge devices and view the sensor data.
 
-The application layer provides the \glspl{API}, data interfaces, and data storage of the \gls{IOT} system.
+The application layer provides the \glspl{API}, data interfaces, data processing, and data storage of the \gls{IOT} system.
 A cloud server or local server provides this layer in a typical home automation application.
 
 The perception layer---also called edge layer---collects the data and interacts with the environment.
 It consists of edge devices such as microcontrollers equipped with various sensors and actuators.
-In home automation this layer consists of all the devices hosting the sensors and actuators such as a smart light bulb, an actuator to open a door or a temperature and humidity sensor.
+In home automation this layer consists of all the devices hosting the sensors and actuators such as smart light bulbs, actuators to open doors or a temperature and humidity sensors.
 
 All layers are connected using the network layer.
-In many applications this is implemented using conventional networking techniques such as WiFi or Ethernet.
+In some applications this is implemented using conventional networking techniques such as WiFi or Ethernet.
 However, networks or layers on top of it---tailored to the needs of the specific interconnection between layers---have been increasingly popular.
 Examples of this are BLE, LoRa, ZigBee, LTE-M, or \gls{MQTT} for connecting the perception layer to the application layer and techniques such as HTTP, AJAX, and WebSocket for connecting the presentation layer to the application layer.
 
 Across the layers, the devices are a large heterogeneous collection of different platforms, protocols, paradigms, and programming languages often resulting in impedance problems or semantic friction between layers when programming \citep{ireland_classification_2009}.
-Even more so, perception layer itself often is a heterogeneous collections of microcontrollers in itself as well, each having their own peculiarities, language of choice, and hardware interfaces.
-As the edge hardware needs to be cheap, small-scale, and energy efficient, the microcontrollers used to power these devices do not have a lot of computational power, only a soup\c{c}on of memory, and little communication bandwidth.
+Even more so, the perception layer itself often is a heterogeneous collections of microcontrollers in itself as well, each having their own peculiarities, language of choice, and hardware interfaces.
+Moreover, as the edge hardware needs to be cheap, small-scale, and energy efficient, the microcontrollers used to power these devices do not have a lot of computational power, only a soup\c{c}on of memory, and little communication bandwidth.
 Typically the devices are unable to run a full-fledged general-purpose \gls{OS} but use compiled firmwares that are written in an imperative language.
 While devices are getting a bit faster, smaller, and cheaper, they keep these properties to an extent, greatly reducing the flexibility for dynamic systems where tasks are created on the fly, executed on demand, or require parallel execution.
 As program memory is mostly flash based and only lasts a couple of thousand writes before it wears out, it is not suitable for rapid reconfiguring and reprogramming.
@@ -245,13 +245,18 @@ enterPerson
        >>! \result->Hint "You Entered:"    @>> viewInformation  [] result[+\label{lst:task_comb}+]
 \end{lstClean}
 
+Functional languages are excellent hosts for \gls{TOP} language 
+\Gls{ITASK} is embedded in a functional language
+
 \subsection{\texorpdfstring{\Gls{MTASK}}{MTask}}
 This thesis uses \gls{ITASK} in conjunction with \gls{MTASK}, an innovative \gls{TOP} language designed for defining interactive systems for \gls{IOT} edge devices \citep{koopman_task-based_2018}.
-Where \gls{ITASK} abstracts away from details such as user interfaces, data storage, and persistent workflows, \gls{MTASK} offers abstractions for edge layer-specific details such as the heterogeneity of architectures, platforms and frameworks; peripheral access; multitasking; task scheduling; and energy consumption.
-It is written in \gls{CLEAN} as a multi-view \gls{EDSL} and hence there are multiple interpretations of the language of which the byte code compiler is the most relevant for this thesis.
-From the terms in the \gls{TOP} language, a very compact binary representation of the work that needs to be done is compiled.
-This specification is then sent to a device that runs the \gls{MTASK} \gls{RTS}, a domain-specific \gls{TOP} engine implemented as a feather-light domain-specific \gls{OS}.
-\Gls{MTASK} is seamlessly integrated with \gls{ITASK}, it allows the programmer to define all layers of an \gls{IOT} system from a single declarative specification.
+Where \gls{ITASK} abstracts away from details such as user interfaces, data storage, client-side platforms, and persistent workflows.
+On the other hand, \gls{MTASK} offers abstractions for edge layer-specific details such as the heterogeneity of architectures, platforms and frameworks; peripheral access; (multi) task scheduling; and lowering energy consumption.
+The \gls{MTASK} language is written in \gls{CLEAN} as a multi-view \gls{EDSL} and hence there are multiple interpretations of the language of which the byte code compiler is the most relevant for this thesis.
+From \gls{MTASK} term constructed at runtime, a very compact binary representation of the work that needs to be done is compiled.
+This byte code is then sent to a device that running the \gls{MTASK} \gls{RTS}, a domain-specific \gls{TOP} engine implemented as a feather-light domain-specific \gls{OS}.
+\Gls{MTASK} is seamlessly integrated with \gls{ITASK}: \gls{MTASK} tasks are integrated in such a way that they function as \gls{ITASK} tasks, and \glspl{SDS} in on the device can tether an \gls{ITASK} \gls{SDS}.
+Using \gls{MTASK}, the programmer defines all layers of an \gls{IOT} system as a single declarative specification.
 
 \todo[inline]{Is this example useful? I think it's too technical}
 \Cref{lst:intro_blink} shows an interactive \gls{MTASK}\slash{}\gls{ITASK} application for blinking \pgls{LED} on the microcontroller every user-specified interval.
@@ -351,9 +356,11 @@ It provides a gentle introduction to the \gls{MTASK} system elaborates on \gls{T
 %              \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}.\footnote{
+       \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}
 
+               These revised lecture notes are from a course on sustainable \gls{IOT} programming in \gls{MTASK} provided at the 2022 SusTrainable summer school in Rijeka, Croatia.
+
 %              \paragraph{Contribution}
 %              These revised lecture notes are from a course on sustainable programming using \gls{MTASK} provided at the 2022 SusTrainable summer school in Rijeka, Croatia.
 %              Pieter prepared and taught a quarter of the lecture and supervised the practical session.