2efb455245778dd70f388da4471a75766e6a8258
[phd-thesis.git] / top / finale.tex
1 \documentclass[../thesis.tex]{subfiles}
2
3 \input{subfilepreamble}
4
5 \setcounter{chapter}{7}
6
7 \begin{document}
8 \input{subfileprefix}
9 \chapter{Finale}%
10 \label{chp:finale}
11 \begin{chapterabstract}
12 This chapter wraps up the monograph by means of:
13 \begin{itemize}
14 \item a conclusion;
15 \item an outlook on future work;
16 \item an overview of the related work;
17 \item and a history of the \gls{MTASK} system.
18 \end{itemize}
19 \end{chapterabstract}
20
21 \section{Finale}
22 Traditionally, \gls{IOT} has been programmed using layered, or tiered, architectures.
23 Every layer has its own software and hardware characteristics, resulting in semantic friction.
24 \Gls{TOP} is a declarative programming paradigm designed to describe multi-tiered interactive systems from a single source.
25 However, it is not straightforward to run \gls{TOP} systems on resource-constrained devices such as edge devices.
26
27 The \gls{MTASK} system bridges this gap by providing a \gls{TOP} programming language for edge devices.
28 It is a full-fledged \gls{TOP} language hosted in a tiny \gls{FP} language.
29 Besides the usual \gls{FP} constructs, it contains basic tasks, task combinators, support for sensors and actuators, and interrupts.
30 It integrates seamlessly in \gls{ITASK}, a \gls{TOP} system for interactive web applications.
31 Hence, all layers of an \gls{IOT} system can be programmed from a single declarative specification.
32 In \gls{ITASK}, abstraction are available for the gritty details of interactive web applications such as program distribution, web applications, data storage, and user management.
33 The \gls{MTASK} system abstracts away of all technicalities specific to edge devices such as communication, abstractions for sensors and actuators, interrupts and (multi) task scheduling.
34
35 Any device equipped with the \gls{MTASK} \gls{RTS} can be used in the system and dynamically receive tasks for execution.
36 This domain-specific \gls{OS} only needs to be uploaded once, hence saving precious write cycles on the program memory.
37 The \gls{MTASK} devices are connected to the \gls{ITASK} system at run time using a single function that takes care of all the communication and error handling.
38 Once connected to a device, tasks written in the \gls{MTASK} \gls{DSL} can be lifted to \gls{ITASK} tasks.
39 The tasks are specified and compiled at run time, i.e.\ \gls{CLEAN} can be used as a macro language for constructing \gls{MTASK} tasks, tailor making them for the current work requirements.
40 When lifted, other tasks in the system can interact with the task through the usual means.
41 Furthermore, \gls{ITASK} \glspl{SDS} can be \emph{lowered} to \gls{MTASK} tasks as well, allowing for bidirectional automatic data sharing between \gls{MTASK} tasks and the \gls{ITASK} system irrespective of task relations.
42
43 \section{Related work}
44 The novelties of the \gls{MTASK} system can be compared to existing systems in several categories.
45 It is a 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}).
46 \Cref{sec_t4t:TiredvsTierless} contains an elaborate related work section regarding tierless systems in general.
47
48 \subsection{Interpretation}\label{sec:related_int}
49 There are a myriad of interpreted programming languages available for some of the bigger more powerful edge devices.
50 For example, for the popular ESP8266 chip there are ports of \gls{MICROPYTHON}, LUA, Basic, JavaScript and Lisp.
51 All of these languages, except the Lisp dialect uLisp (see \cref{sec:related_fp}), are imperative and do not support multitasking out of the box.
52 They lay pretty hefty constraints on the memory and as a result do not work on smaller microcontrollers.
53 Another 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}.
54 \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.
55 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}.
56 It differs from our approach because continuation points need to be defined by hand there is no automatic safe data communication.
57
58 \Citet{baccelli_reprogramming_2018} provide a single language \gls{IOT} system based on the RIOT \gls{OS} that allows runtime deployment of code snippets called containers.
59 Both client and server are written in JavaScript.
60 However, there is no integration between the client and the server other than that they are programmed from a single source.
61 Mat\`e is an example of an early tierless sensor network framework where devices are provided with a virtual machine using TinyOS for dynamic provisioning \citep{levis_mate_2002}.
62
63 \subsection{\texorpdfstring{\Glsxtrlongpl{DSL}}{DSLs} for microcontrollers}\label{sec:related_dsl}
64 Many \glspl{DSL} provide higher-level programming abstractions for microcontrollers, for example providing strong typing or memory safety.
65 Examples of this are Copilot \citep{hess_arduino-copilot_2020} and Ivory \citep{elliott_guilt_2015}, imperative \glspl{DSL} embedded in a functional language that compile to \ccpp{}.
66
67 \subsection{\texorpdfstring{\Glsxtrlong{FP}}{Functional programming}}\label{sec:related_fp}
68 \Citet{haenisch_case_2016} showed that there are major benefits to using functional languages for \gls{IOT} applications.
69 They showed that using function languages increased the security and maintainability of the applications.
70 Traditional implementations of general purpose functional languages have high memory requirements rendering them unusable for tiny computers.
71 There have been many efforts to create a general purpose functional language that does fit in small memory environments, albeit with some concessions.
72 For example, there has been a history of creating tiny Scheme implementations for specific microcontrollers.
73 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.
74 \Citet{suchocki_microscheme:_2015} created Microscheme, a functional language targeting \gls{ARDUINO} compatible microcontrollers.
75 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.
76 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}.
77
78 \subsection{Multitasking}\label{sec:related_multi}
79 Applications for tiny computers are often parallel in nature.
80 Tasks like reading sensors, watching input devices, operating actuators and maintaining communication are often loosely dependent on each other and are preferably executed in parallel.
81 Microcontrollers often do not benefit from an \gls{OS} due to memory and processing constraints.
82 Therefore, writing multitasking applications in an imperative language is possible but the tasks have to be interleaved by hand \citep{feijs_multi-tasking_2013}.
83 This results in hard to maintain, error prone and unscalable spaghetti code.
84
85 There are many solutions to overcome this problem in imperative languages.
86 If the host language is a functional language (e.g.\ the aforementioned scheme variants) multitasking can be achieved without this burden relatively easy using continuation style multiprocessing \citep{wand_continuation-based_1980}.
87 Writing in this style is complicated and converting an existing program in this continuation passing style results in relatively large programs.
88 Furthermore, there is no built-in thread-safe communication possible between the tasks.
89 A \gls{TOP} or \gls{FRP} based language benefits even more because the programmer is not required to explicitly define continuation points.
90
91 Regular preemptive multithreading is too memory intensive for smaller microcontrollers and therefore not suitable.
92 Manual interleaving of imperative code can be automated to certain extents.
93 Solutions often require an \gls{RTOS}, have a high memory requirement, do not support local variables, no thread-safe shared memory, no composition or no events as described in \cref{tbl:multithreadingcompare}.
94 This table extends a comparison table with various solutions to multitasking to \gls{MTASK} in the relevant categories.
95 \todo[inline]{Uitleg over de talen geven}
96
97 \begin{table}
98 \begin{threeparttable}
99 \caption{%
100 An overview of imperative multithreading solutions for tiny computers with their relevant characteristics.
101 The characteristics are: sequential computing, local variable support, parallel composition, deterministic execution, bounded execution and safe shared memory (adapted from \citet[p.\ 12]{santanna_safe_2013}).
102 }\label{tbl:multithreadingcompare}
103 % \begin{tabular}{lc>{\columncolor[gray]{0.95}}cc>{\columncolor[gray]{0.95}}cc>{\columncolor[gray]{0.95}}cc}
104 \begingroup
105 % default is 6pt
106 \setlength\tabcolsep{4.5pt}
107 \begin{tabular}{lccccccc}
108 \toprule
109 \multicolumn{2}{c}{Language} & \multicolumn{3}{c}{Complexity} & \multicolumn{3}{c}{Safety}\\
110 \midrule
111 Name & Year & SeqCmp & LocVar & ParCmp & DetEx & BndEx & SafeMem\\
112 \midrule
113 Preemptive & many & \CIRCLE{} & \CIRCLE{} & \Circle{} & \Circle{} & rt & \Circle{}\\
114 nesC & 2003 & \Circle{} & \Circle{} & \Circle{} & \CIRCLE{} & async & \Circle{}\\
115 OSM & 2005 & \Circle{} & \CIRCLE{} & \CIRCLE{} & \Circle{} & \Circle{} & \Circle{}\\
116 Protothreads & 2006 & \CIRCLE{} & \Circle{} & \Circle{} & \CIRCLE{} & \Circle{} & \Circle{}\\
117 TinyThreads & 2006 & \CIRCLE{} & \CIRCLE{} & \Circle{} & \CIRCLE{} & \Circle{} & \Circle{}\\
118 Sol & 2007 & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \Circle{} & \Circle{}\\
119 FlowTask & 2011 & \CIRCLE{} & \CIRCLE{} & \Circle{} & \Circle{} & \Circle{} & \Circle{}\\
120 Ocram & 2013 & \CIRCLE{} & \CIRCLE{} & \Circle{} & \CIRCLE{} & \Circle{} & \Circle{}\\
121 C\'eu & 2013 & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \CIRCLE{}\\
122 \gls{MTASK} & 2022 & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \CIRCLE{} & \LEFTcircle{}\tnote{1} & \LEFTcircle{}\tnote{2}\\
123 \bottomrule
124 \end{tabular}
125 \endgroup
126 \begin{tablenotes}
127 \item [1] Only for tasks, not for expressions.
128 \item [2] Using \glspl{SDS}.
129 \end{tablenotes}
130 \end{threeparttable}
131 \end{table}
132
133 \subsection{\texorpdfstring{\Glsxtrlong{FRP}}{Functional reactive programming}}\label{sec:related_frp}
134 The \gls{TOP} paradigm is often compared to \gls{FRP} and they appear to be similar.
135 \Gls{FRP} was introduced by \citet{elliott_functional_1997}.
136 The paradigm strives to make modelling systems safer, more efficient, composable.
137 The core concepts are behaviours and events.
138 A behaviour is a value that varies over time.
139 Events are happenings in the real world and can trigger behaviours.
140 Events and behaviours may be combined using combinators.
141 Tasks in \gls{TOP} are also event driven and can be combined with combinators.
142 \Gls{TOP} allows for more complex collaboration patterns than \gls{FRP} \citep{wang_maintaining_2018}.
143 In consequence is unable to provide the strong guarantees on memory usage available in a restricted variant of \gls{FRP} such as arrowised \gls{FRP} \citep{nilsson_functional_2002}.
144
145 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.
146 The \gls{IOT} domain seems to suit this style of programming very well in just the device layer but also for entire \gls{IOT} systems.
147
148 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}.
149 It requires client devices to be able to run the Erlang \gls{VM} which makes it unsuitable for low memory environments.
150
151 The emfrp language compiles a \gls{FRP} specification for a microcontroller to \gls{C} code \citep{sawada_emfrp:_2016}.
152 The \gls{IO} part, the bodies of some functions, still need to be implemented.
153 These \gls{IO} functions can then be used as signals and combined as in any \gls{FRP} language.
154 Due to the compilation to \gls{C} it is possible to run emfrp programs on tiny computers.
155 However, in contrast to in \gls{MTASK}, the tasks are not interpreted and there is no automated communication with a server.
156
157 Other examples are 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 \citep{hess_arduino-copilot_2020}.
158
159 \subsection{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}\label{sec:related_top}
160 \Gls{TOP} as a paradigm with has been proven to be effective for implementing distributed, multi-user applications in many domains.
161 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}.
162 In general, \gls{TOP} results in a higher maintainability, a high separation of concerns and more effective handling of interruptions of workflow.
163 \Gls{IOT} applications contain a distributed and multi-user component, but the software on the device is mostly follows multiple loosely dependent workflows.
164 The only other \gls{TOP} language for embedded systems is $\mu$Tasks \citep{piers_task-oriented_2016}.
165 It is a non-distributed \gls{TOP} \gls{EDSL} hosted in \gls{HASKELL} designed for embedded systems such as payment terminals.
166 They showed that applications tend to be able to cope well with interruptions and be more maintainable.
167 However, the hardware requirements for running the standard \gls{HASKELL} system are high.
168
169 \section{Future work}
170 There are many ways of extending the research on the \gls{MTASK} system that also concerns \gls{TOP} for resource constrained devices in general.
171 Some obvious routes is to add features, support more platforms,
172
173 \subsection{Security}
174 \Gls{IOT} has reached the news many times regarding security and it is a big concern \citep{alhirabi_security_2021}.
175 The fact that the devices are embedded in the fabric, are hard to reach and thus to update, and can only run limited cryptographic algorithms due to their constrained resources makes security difficult.
176 The security of \gls{MTASK} and the used protocols are deliberately overlooked at the moment
177 The \gls{MTASK} language and \gls{RTS} are modular.
178 For example, the communication channels are communication method agnostic and operate through a simple duplex channel interface.
179 It should therefore be fairly easy to apply standard security measures to them by replacing communication methods and applying off-the-shelve authentication and encryption to the protocol.
180 \Citet{de_boer_secure_2020} did preliminary research on securing the communication channels, which proved to be possible without many changes in the protocol.
181 Nonetheless, this deserves much more attention.
182 The future and related work for the security of \gls{MTASK} and tierless systems is more thoroughly presented in \cref{ssec_t4t:security}.
183
184 \subsection{Advanced edge devices techniques}
185 Edge devices may produce a lot of data and it is not always effective to send this data to the server for processing.
186 Leaving the produced data and computations on the edge device is called \emph{edge computing} \citep{shi_edge_2016}.
187 The \gls{MTASK} exhibits many properties of edge computing because it is possible to run entire workflows on the device.
188 However, it is interesting to see how far this can be extended.
189 The \gls{MTASK} language is a high-level \gls{DSL}, so it is obvious to introduce abstractions for edge computations.
190 For example, add \gls{TOP} support for machine learning on the edge device using TinyML \citep{sanchez-iborra_tinyml-enabled_2020}.
191 \Citet{van_der_veen_mutable_2020} did preliminary work for embedding bounded datastructures such as arrays to the language.
192 This could be continued and extended with support for sum types.
193
194 Another recent advance in \gls{IOT} programming is battery-less or even battery-free computing.
195 Instead of equipping the edge device with a battery, a capacitor is used in conjunction with some energy harvesting systems such as a solar panel.
196 With the use of intermittent computing, resuming the computation after a, possibly unexpected, power loss, operation can still be achieved \citep{hester_batteries_2019}.
197 After a reset, the program state is resumed from a checkpoint that was stored in some non-volatile memory.
198 Many intermittent computing solutions rely on annotations from the programmer to divide the program into atomic blocks, sometimes called \emph{tasks} as well.
199 These blocks are marked as such because in the case of an reset of the system, the work must be done again.
200 Examples of such blocks are \gls{I2C} transmissions or calculations that rely on recent sensor data.
201 In \gls{MTASK}, all work expressed by tasks is already split up in atomic pieces of work, i.e.\ the work is a side effect of rewriting.
202 Furthermore, creating checkpoints should be fairly straightforward as \gls{MTASK} tasks do not rely on any global state---all information required to execute a task is stored in the task tree.
203 It is interesting to see what \gls{TOP} abstraction could be useful for intermittent computing and what solutions are required to make this work.
204
205 Mesh networks allow for communication not only to-and-fro the device and server but also between devices.
206 The \gls{ITASK} system already contains primitives for distributed operation.
207 For example, it is possible to run tasks or share data with \glspl{SDS} on a different machine.
208 It is interesting to investigate how this networking technique can be utilised in \gls{MTASK}.
209
210 Finally, \glspl{FPGA} have been becoming cheaper and faster recently, allowing for purely functional code to be translated to \glspl{FPGA} code efficiently \citep{baaij_digital_2015}.
211 It would be interesting to see how and whether (parts of) \gls{TOP} programs or the functionality of the \gls{MTASK} \gls{OS} could be translated to \gls{FPGA} specifications.
212
213 \subsection{Formal semantics}
214 Semantics allow reasoning about the language and programs in order do (symbolic) simulation, termination checking, task equivalence, or otherwise.
215 For \gls{ITASK} there have been two attempts to formally specify the language.
216 First \citet{koopman_executable_2011} defined a semantics used for property based testing based on a minimal version of \gls{ITASK}.
217 Then \citet{plasmeijer_task-oriented_2012} formalised \gls{ITASK} by providing an executable semantics for the language.
218 Both semantics are not suitable for formal reasoning due to the complexity.
219 Later, \citet{steenvoorden_tophat_2019} created \gls{TOPHAT}, a \gls{TOP} language with a complete formal specification with similar features to \gls{MTASK} \citep{steenvoorden_tophat_2019}.
220 \Citet{antonova_mtask_2022} compared parts of \gls{MTASK} to the semantics of \gls{TOPHAT} semantics and created a preliminary semantics for a subset of \gls{MTASK}.
221 Future research into extending the formal semantics of \gls{MTASK} is useful to give more guarantees on \gls{MTASK} programs.
222
223 \subsection{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}
224 In order to keep the resource constraints low, the \gls{MTASK} language contains only a minimal set of simple task combinators.
225 From these simple combinators, complex collaboration patterns can be described.
226 The \gls{ITASK} language is designed exactly the opposite.
227 From just a few super combinators, all other combinators are derived.
228 However, this approach requires a very powerful host language in which task combinators can be defined in terms of the host language.
229 It could be fruitful to investigate which workflows cannot be specified with the limited set of combinators available in \gls{MTASK}.
230 Furthermore, it is unclear whether all derived combinators from \gls{ITASK} can be expressed in terms of \gls{MTASK} combinators.
231 \Citet{van_der_aalst_workflow_2003} defines a benchmark set of workflow patterns.
232 It is interesting to see which patterns can be implemented with \gls{MTASK}, and what additional combinators are needed.
233 Moreover, editors are a crucial part of \gls{TOP}.
234 In \gls{MTASK}, sensors can be seen as read-only shared editors that are updated by the system.
235 It is interesting to investigate how actual interactive editors would fit in \gls{MTASK}.
236 For example, many smartwatches contain touch sensitive screens that could be used to interact with the user in this way.
237 Alternatively, sufficiently powerful edge devices can probably run simple web interfaces as well.
238
239 \Glspl{SDS} in \gls{ITASK} have a rich set of combinators to transform and combine the \glspl{SDS} into new \gls{SDS}.
240 In \gls{MTASK}, \glspl{SDS} are typed global variables that may or may not proxy an \gls{ITASK} \gls{SDS}.
241 It could be interesting to port the \gls{SDS} combinators to \gls{MTASK} as well, allowing them to be transformed and combined also.
242
243 \subsection{Usability}
244 The promise of \glspl{DSL} has often been that a domain expert could program with little technical knowledge of the host programming language.
245 Some even propose that a \gls{DSL} is a \gls{UI} for domain experts to computation platforms \citep{management_association_evaluating_2014}.
246 In practise this is not always the case due to crippling syntax and convoluted error messages.
247 Recent approaches in interactive editors for programming language source code such as dynamic editors \citep{koopman_dynamic_2021} or typed tree editors such as Hazelnut \citep{omar_hazelnut_2017} could prove useful for supporting the \gls{DSL} programmer in using \gls{MTASK}.
248 If the editor produces correct \gls{MTASK} code by construction, much of the problems could be avoided.
249 In the same respect, as \gls{MTASK} is a tagless-final \gls{EDSL} and uses \gls{HOAS}, the error messages are complex and larded with host language features.
250 Much research has gone into simplifying these error messages by translating them to the \gls{DSL} domain, see for example \citep{serrano_type_2018}.
251 De Roos briefly investigated these methods in their research internship.
252 A future directions could be to extend these findings and apply more \gls{EDSL} error message techniques on \gls{MTASK} as well.
253
254 \subsection{Language features}
255 The serialisation and deserialisation of data types is automated both on the server and the \gls{MTASK} device using generic programming.
256 Using the structural information of the data type, the code responsible for the functionality is automatically generated.
257 Peripherals are not yet fully integrated in such a way.
258 When a peripheral is added, the programmer has to define the correct byte code, implement the instructions in the interpreter, add task tree nodes, and implement them in the rewrite system.
259 It would be interesting to investigate whether this can be automated or centralised in a way.
260
261 More elaborate features in the type systems of modern functional programming languages allow for more type safety.
262 The \gls{MTASK} language relies a lot on these features such as (multi-parameter) type classes and existential data types with class constraints.
263 However, it should be possible to make abstractions over more stuff to make it safer.
264 For example, the pin mode could be made a type parameter of the \gls{GPIO} pins, or interrupt handling could be made safer by incorporating the capabilities of the devices.
265
266 \subsection{Scheduling}
267 The scheduling in \gls{MTASK} works quite well but it is not real time.
268 There is a variant of \gls{FRP} called \gls{PFRP} that allows for real-time operation \citep{belwal_variable_2013}.
269 Furthermore, an alternative to reducing the energy consumption by going to sleep is stepping down the processor frequency.
270 So called \gls{DVFS} is a scheduling technique that slows down the processor in order to reach the goals as late as possible, reducing the power consumption.
271 \Citet{belwal_variable_2013} use \gls{PFRP} with \gls{DVFS} to reduce the energy consumption.
272 It is interesting to investigate the possibilities for \gls{DVFS} in \gls{MTASK} and \gls{TOP} in general.
273
274 \section{History of \texorpdfstring{\gls{MTASK}}{mTask}}
275 The development of \gls{MTASK} or its predecessors has been going on for almost seven years now though it really set off during my master's thesis.
276 Many colleagues and students have worked on aspects of the \gls{MTASK} system in collaborations, internships and Bachelor and Master's theses.
277 This section provides an exhaustive overview of the work on \gls{MTASK} and its predecessors.
278
279 \subsection{Generating \ccpp{} code}
280 A first throw at a class-based shallowly \gls{EDSL} for microcontrollers was made by \citet{plasmeijer_shallow_2016}.
281 The language was called \gls{ARDSL} and offered a type safe interface to \gls{ARDUINO} \gls{CPP} dialect.
282 A \gls{CPP} code generation backend was available together with an \gls{ITASK} simulation backend.
283 There was no support for tasks nor even functions.
284 Some time later in the 2015 \gls{CEFP} summer school, an extended version was created that allowed the creation of imperative tasks, local \glspl{SDS} and the usage of functions \citep{koopman_type-safe_2019}.
285 The name then changed from \gls{ARDSL} to \gls{MTASK}.
286
287 \subsection{Integration with \texorpdfstring{\gls{ITASK}}{iTask}}
288 \Citet{lubbers_task_2017} extended this in his Master's Thesis by adding integration with \gls{ITASK} and a bytecode compiler to the language.
289 \Gls{SDS} in \gls{MTASK} could be accessed on the \gls{ITASK} server.
290 In this way, entire \gls{IOT} systems could be programmed from a single source.
291 However, this version used a simplified version of \gls{MTASK} without functions.
292 This was later improved upon by creating a simplified interface where \glspl{SDS} from \gls{ITASK} could be used in \gls{MTASK} and the other way around \citep{lubbers_task_2018}.
293 It was shown by \citet{amazonas_cabral_de_andrade_developing_2018} that it was possible to build real-life \gls{IOT} systems with this integration.
294 Moreover, 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 \citep{koopman_simulation_2023}.
295
296 \subsection{Transition to \texorpdfstring{\glsxtrlong{TOP}}{Task-oriented programming}}
297 The \gls{MTASK} language as it is now was introduced in 2018 \citep{koopman_task-based_2018}.
298 This paper updated the language to support functions, simple tasks, and \glspl{SDS} but still compiled to \gls{ARDUINO} \gls{CPP} code.
299 Later the byte code compiler and \gls{ITASK} integration was added to the language \citep{lubbers_interpreting_2019}.
300 Moreover, it was shown that it is very intuitive to write microcontroller applications in a \gls{TOP} language \citep{lubbers_multitasking_2019}.
301 One reason for this is that a lot of design patterns that are difficult using standard means are for free in \gls{TOP} (e.g.\ multithreading).
302 In 2019, the \gls{CEFP}\slash\gls{3COWS} summer school in Budapest, Hungary hosted a course on developing \gls{IOT} applications with \gls{MTASK} as well \citep{lubbers_writing_2023}.
303
304 \subsection{\texorpdfstring{\Glsxtrlong{TOP}}{Task-oriented programming}}
305 In 2022, the SusTrainable summer school in Rijeka, Croatia hosted a course on developing greener \gls{IOT} applications using \gls{MTASK} as well \citep{lubbers_green_2022}.
306 Several students worked on extending \gls{MTASK} with many useful features:
307 \Citet{van_der_veen_mutable_2020} did preliminary work on a green computing analysis, built a simulator, and explored the possibilities for adding bounded datatypes; de Roos explored beautifying error messages; \citet{de_boer_secure_2020} investigated the possibilities for secure communication channels; \citeauthor{crooijmans_reducing_2021} \citeyearpar{crooijmans_reducing_2021,crooijmans_reducing_2022} added abstractions for low-power operation to \gls{MTASK} such as hardware interrupts and power efficient scheduling; and \citet{antonova_mtask_2022} defined a preliminary formal semantics for a subset of \gls{MTASK}.
308 In 2023, the SusTrainable summer school in Coimbra, Portugal will host a course on \gls{MTASK} as well.
309
310 \subsection{\texorpdfstring{\gls{MTASK}}{mTask} in practise}
311 Funded by the Radboud-Glasgow Collaboration Fund, collaborative work was executed with Phil Trinder, Jeremy Singer, and Adrian Ravi Kishore Ramsingh.
312 An existing smart campus application was developed using \gls{MTASK} and quantitatively and qualitatively compared to the original application that was developed using a traditional \gls{IOT} stack \citep{lubbers_tiered_2020}.
313 This research was later extended to include a four-way comparison: \gls{PYTHON}, \gls{MICROPYTHON}, \gls{ITASK}, and \gls{MTASK} \citep{lubbers_could_2022}.
314 Currently, power efficiency behaviour of traditional versus \gls{TOP} \gls{IOT} stacks is being compared as well adding a \gls{FREERTOS}, and an elixer/potato implementation to the mix as well.
315
316 \input{subfilepostamble}
317 \end{document}