many smalle updates
[phd-thesis.git] / concl / concl.tex
1 \documentclass[../thesis.tex]{subfiles}
2
3 \input{subfilepreamble}
4
5 \begin{document}
6 \input{subfileprefix}
7 \chapter{Coda}%
8 \label{chp:conclusion}
9 \section{Conclusion}
10
11 \section{Future work}
12
13 \section{Related work}
14 This section describes the related work.
15 The novelties of the \gls{MTASK} system can be compared to existing systems in several categories.
16 It is a tierless (\cref{sec:related_tierless}), interpreted (\cref{sec:related_int}) \gls{TOP} (\cref{sec:related_top}) \gls{DSL} (\cref{sec:related_dsl}) that may seem similar at first glance to \gls{FRP} (\cref{sec:related_frp}), it is implemented in a functional language (\cref{sec:related_fp}) and due to the execution semantics, multitasking is automatically supported (\cref{sec:related_multi}).
17 \todo{uit\-brei\-den waar mo\-ge\-lijk}
18
19 \subsection{Interpretation}\label{sec:related_int}
20 There are a myriad of interpreted programming languages available for some of the bigger devices.
21 For example, for the popular ESP8266 chip there are ports of \gls{MICROPYTHON}, LUA, Basic, JavaScript and Lisp.
22 All of these languages, except the Lisp dialect uLisp (see \cref{ssec:related_fp}), are imperative and do not support multithreading out of the box.
23 They lay pretty hefty constraints on the memory and as a result do not work on smaller microcontrollers.
24 A interpretation solution for the tiniest devices is Firmata, a protocol for remotely controlling the microcontroller and using a server as the interpreter host \citep{steiner_firmata:_2009}.
25 \citet{grebe_haskino:_2016} wrapped this in a remote monad for integration with \gls{HASKELL} that allowed imperative code to be interpreted on the microprocessors.
26 Later this system was extended to support multithreading as well, stepping away from Firmata as the basis and using their own \gls{RTS} \citep{grebe_threading_2019}.
27 It differs from our approach because continuation points need to be defined by hand there is no automatic safe data communication.
28
29 \subsubsection{\texorpdfstring{\Glsxtrlongpl{DSL}}{DSLs} for microcontrollers}\label{sec:related_dsl}
30 Many \glspl{DSL} provide higher-level programming abstractions for microcontrollers, for example providing strong typing or memory safety.
31 For example Copilot \citep{hess_arduino-copilot_2020} and Ivory \citep{elliott_guilt_2015} are imperative \glspl{DSL} embedded in a functional language that compile to \ccpp{}.
32
33 \subsection{\texorpdfstring{\Glsxtrlong{FP}}{Functional programming}}\label{sec:related_fp}
34 \Citet{haenisch_case_2016} showed that there are major benefits to using functional languages for \gls{IOT} applications.
35 They showed that using function languages increased the security and maintainability of the applications.
36 Traditional implementations of general purpose functional languages have high memory requirements rendering them unusable for tiny computers.
37 There have been many efforts to create a general purpose functional language that does fit in small memory environments, albeit with some concessions.
38 For example, there has been a history of creating tiny Scheme implementations for specific microcontrollers.
39 It started with BIT \citep{dube_bit:_2000} that only required \qty{64}{\kibi\byte} of memory, followed by {PICBIT} \citep{feeley_picbit:_2003} and {PICOBIT} \citep{st-amour_picobit:_2009} that lowered the memory requirements even more.
40 More recently, \citep{suchocki_microscheme:_2015} created Microscheme, a functional language targeting \gls{ARDUINO} compatible microcontrollers.
41 The {*BIT} languages all compile to assembly while Microscheme compiles to \gls{CPP}, heavily supported by \gls{CPP} lambdas available even on \gls{ARDUINO} AVR targets.
42 An interpreted Lisp implementation called uLisp also exists that runs on microcontrollers with as small as the \gls{ARDUINO} {UNO} \citep{johnson-davies_lisp_2020}.
43
44 \subsection{\texorpdfstring{\Glsxtrlong{FRP}}{Functional reactive programming}}\label{sec:related_frp}
45 The \gls{TOP} paradigm is often compared to \gls{FRP} and while they appear to be similar---they both process events---, in fact they are very different.
46 \Gls{FRP} was introduced by \citet{elliott_functional_1997}.
47 The paradigm strives to make modelling systems safer, more efficient, composable.
48 The core concepts are behaviours and events.
49 A behaviour is a value that varies over time.
50 Events are happenings in the real world and can trigger behaviours.
51 Events and behaviours may be combined using combinators.
52 \Gls{TOP} allows for more complex collaboration patterns than \gls{FRP} \citep{wang_maintaining_2018}, and in consequence is unable to provide the strong guarantees on memory usage available in a restricted variant of \gls{FRP} such as arrowized \gls{FRP} \citep{nilsson_functional_2002}.
53
54 The way \gls{FRP}, and for that matter \gls{TOP}, systems are programmed stays close to the design when the domain matches suits the paradigm.
55 The \gls{IOT} domain seems to suit this style of programming very well in just the device layer\footnote{While a bit out of scope, it deserves mention that for \gls{SN}, \gls{FRP} and stream based approaches are popular as well \citep{sugihara_programming_2008}.} but also for entire \gls{IOT} systems.
56
57 For example, Potato is an \gls{FRP} language for building entire \gls{IOT} systems using powerful devices such as the Raspberry Pi leveraging the Erlang \gls{VM} \citep{troyer_building_2018}.
58 It requires client devices to be able to run the Erlang \gls{VM} which makes it unsuitable for low memory environments.
59
60 The emfrp language compiles a \gls{FRP} specification for a microcontroller to \gls{C} code \citep{sawada_emfrp:_2016}.
61 The \gls{IO} part, the bodies of some functions, still need to be implemented.
62 These \gls{IO} functions can then be used as signals and combined as in any \gls{FRP} language.
63 Due to the compilation to \gls{C} it is possible to run emfrp programs on tiny computers.
64 However, the tasks are not interpreted and there is no communication with a server.
65
66 Other examples are mfrp \citep{sawada_emfrp:_2016}, CFRP \citep{suzuki_cfrp_2017}, XFRP \citep{10.1145/3281366.3281370}, Juniper \citep{helbling_juniper:_2016}, Hailstorm \citep{sarkar_hailstorm_2020}, Haski \citep{valliappan_towards_2020}, arduino-copilot~\cite{hess_arduino-copilot_2020}.
67
68 \subsection{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}\label{sec:related_top}
69 \Gls{TOP} as a paradigm with has been proven to be effective for implementing distributed, multi-user applications in many domains.
70 Examples are conference management \citep{plasmeijer_conference_2006}, coastal protection \citep{lijnse_capturing_2011}, incident coordination \citep{lijnse_incidone:_2012}, crisis management \citep{jansen_towards_2010} and telemedicine \citep{van_der_heijden_managing_2011}.
71 In general, \gls{TOP} results in a higher maintainability, a high separation of concerns and more effective handling of interruptions of workflow.
72 \Gls{IOT} applications contain a distributed and multi-user component, but the software on the device is mostly follows multiple loosely dependent workflows.
73 The only other \gls{TOP} language for embedded systems is $\mu$Tasks \citep{piers_task-oriented_2016}.
74 It is a non-distributed \gls{TOP} \gls{EDSL} hosted in \gls{HASKELL} designed for embedded systems such as payment terminals.
75 They showed that applications tend to be able to cope well with interruptions and be more maintainable.
76 However, the hardware requirements for running the standard \gls{HASKELL} system are high.
77
78 \subsection{Multi tasking}\label{sec:related_multi}
79
80 \subsection{Tierless programming on microcontrollers}\label{sec:related_tierless}
81
82 \input{subfilepostamble}
83 \end{document}