sweeeeep
[msc-thesis1617.git] / conclusion.tex
index 406c744..0473625 100644 (file)
@@ -1,11 +1,6 @@
-\section{Discussion}
-\todo{class based shallow doesn't have multiple backend support}
-\todo{slow client software because of interpretation}
-\todo{What happens if a device dies? Task resending, add to handshake}
-
-\section{Future Research}
-The system is still crude and a proof of concept. Improvements and extension
-for the system are amply available in several fields of study.
+\section{Discussion \& Future Research}
+The system is still a crude prototype and a proof of concept. Improvements and
+extension for the system are amply available in several fields of study.
 
 \subsection{Simulation}
 An additional simulation view to the \gls{mTask}-\gls{EDSL} could be added that
@@ -17,8 +12,8 @@ the \emph{POSIX}-client is the reference client and contains debugging code.
 Adding a simulation view to the system allows for easy interactive debugging.
 However, it might not be easy to devise a simulation tool that accurately
 simulates the \gls{mTask} system accurately on some levels. The semantics can
-be simulated but timing and peripheral input/output are more
-difficult to simulate properly.
+be simulated but timing and peripheral input/output are more difficult to
+simulate properly.
 
 \subsection{Optimization}
 True multitasking could be added to the client software. This allows
@@ -33,14 +28,20 @@ the multithreading capabilities of the client.
 Hardly any work has been done in the interpreter. The current interpreter is a
 no nonsense stack machine. A lot of improvements can be done in this part. For
 example, precomputed \emph{gotos} can improve jumping to the correct part of
-the code corresponding to the correct instruction.
+the code corresponding to the correct instruction. Moreover, the stack
+currently consists of 16-bit values. All operations work on 16-bit values and
+this simplifies the interpreter implementation. A memory improvement can be
+made by converting the stack to 8-bit values. This does pose some problems
+since an equality instruction must work on single-byte booleans \emph{and}
+two-byte integers. Adding specialized instructions per word size could overcome
+this problem.
 
 \subsection{Resources}
 Resource analysis during compilation can be useful to determine if an
 \gls{mTask}-\gls{Task} is suitable for a specific device. If the device does
-not contain the correct peripherals such as an \gls{LCD} then the
+not contain the correct peripherals --- such as an \gls{LCD} --- then the
 \gls{mTask}-\gls{Task} should be rejected and feedback to the user must be
-given. 
+given. It might even be possible to do this statically on the type level.
 
 This idea could be extended to the analysis of stack size and possibly
 communication bandwidth. With this functionality ever more reliable fail-over
@@ -54,9 +55,9 @@ embedding. It might even be possible to encode the resource allocation in the
 type system itself using forms of dependant types.
 
 \subsection{Functionality}
-More \gls{Task}-combinators already existing in the \gls{iTasks}-system could
-be added to the \gls{mTask}-system to allow for more fine-grained control flow
-between \gls{mTask}-\glspl{Task}. In this way the new system follows the
+More \gls{Task}-combinators --- already existing in the \gls{iTasks}-system ---
+could be added to the \gls{mTask}-system to allow for more fine-grained control
+flow between \gls{mTask}-\glspl{Task}. In this way the new system follows the
 \gls{TOP} paradigm even more and makes programming \glspl{mTask} for
 \gls{TOP}-programmers more seamless. Some of the combinators require previously
 mentioned extension such as the parallel combinator. Others might be achieved
@@ -69,20 +70,41 @@ programming and less communication resources. Adding these semantics requires
 modifications to the client software and extensions to the communication
 protocol since relations between \glspl{Task} also need to be encoded and
 communicated.
+
+\subsection{Robustness}
+The robustness of the system can be greatly improved. Devices that lose
+connection are in the current system not well supported. The device will stop
+functioning and have to be emptied for a reconnect. \Glspl{Task} residing on a
+device that disconnected should be kept on the server to allow a swift
+reconnect and restoration of the \glspl{Task}. This holds the same for the
+client software. The client drops all existing \glspl{Task} on a shutdown
+request. An extra specialization of the shutdown could be added that drops the
+connection but keeps the \glspl{Task} in memory. During the downtime the
+\glspl{Task} can still be executed but publications need to be delayed. If the
+same server connects to the client the delayed publications can be sent
+anyways.
+
+Moreover, devices could send their current \glspl{Task} back at the
+server to synchronize it. This allows interchanging servers without
+interrupting the client. Allowing the client to send \glspl{Task} to the server
+is something to handle with care because it can easily cause high bandwidth
+usage.
+
 \section{Conclusion}
-This thesis introduces a new view for the existing \gls{mTask}-\gls{EDSL}.
-The new view for the \gls{EDSL} compiles the language in to bytecode that can
-be interpreted by an \gls{mTask}-client. Clients have been written for several
-microcontrollers and consumer architectures that can be connected through
-various means of communication such as serial, bluetooth, wifi and wired
-network communication. The bytecode on the devices is interpreted using a
-simple stack machine and provides the programmer interfaces to the peripherals.
-The semantics of the \glspl{mTask} tries to resemble the \gls{iTasks} semantics
-as close as possible.
+This thesis introduces a novel system for add \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,
+bluetooth, wifi and wired network communication. The bytecode on the devices is
+interpreted using a stack machine and provides the programmer interfaces
+to the peripherals. The semantics of the \glspl{mTask} tries to resemble the
+\gls{iTasks} semantics as close as possible.
 
 The host language has a very efficient compiler and code generator. Therefore,
-the \gls{mTask}-system is also relatively fast because the compilation of
-\glspl{mTask} is nothing more than running some functions in the host language.
+compiling \glspl{mTask} is also fast. Compiling \glspl{mTask} is nothing
+more than running some functions native to the host language.
 
 The dynamic nature allows the microcontroller to be programmed once and used
 many times. The program memory of microcontrollers often guarantees around