This thesis introduces a novel system for adding \gls{IoT} functionality to
the \gls{TOP} implementation \gls{iTasks}. A new view for the existing
\gls{mTask}-\gls{EDSL} has been created which compiles the program
into bytecode that can be interpreted by a client. Clients have
been written for several microcontrollers and consumer architectures which can
be connected through various means of communication such as serial port,
wifi and wired network communication. The bytecode on the devices is
interpreted using a stack machine and provides the programmer with interfaces
to the peripherals. The semantics for \gls{mTask} try to resemble the
\gls{iTasks} semantics as close as possible.

The host language has a proven efficient compiler and code generator. The
compilation is linear in the amount of instructions generated and is therefore
also scalable. Moreover, compiling \glspl{Task} is fast because it is nothing
more than running some functions native to the host language and there is no
intermediate \gls{AST}.

The dynamic nature of the client allows the microcontroller to be programmed
once and used many times. The program memory of microcontrollers often
guarantees around $10.000$ write or upload cycles and therefore existing
techniques such as generating \gls{C} code are not suitable for dynamic
\gls{Task} environments. The dynamic nature also allows the programmer to
design fail-over mechanisms. When a device is assigned a \gls{Task} but another
device suddenly becomes unusable, the \gls{iTasks} system can reassign a new
\gls{mTask}-\gls{Task} to another device that is also suitable for running the
\gls{Task} without needing to recompile the code.
