source: doc/theses/andrew_beach_MMath/intro.tex @ d3b95f1

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since d3b95f1 was 4ed7946e, checked in by Peter A. Buhr <pabuhr@…>, 3 years ago

proofread Andrew's thesis chapters

  • Property mode set to 100644
File size: 4.5 KB
Line 
1\chapter{Introduction}
2
3\PAB{Stay in the present tense. \newline
4\url{https://plg.uwaterloo.ca/~pabuhr/technicalWriting.shtml}}
5\newline
6\PAB{Note, \lstinline{lstlisting} normally bolds keywords. None of the keywords in your thesis are bolded.}
7
8% Talk about Cforall and exceptions generally.
9%This thesis goes over the design and implementation of the exception handling
10%mechanism (EHM) of
11%\CFA (pernounced sea-for-all and may be written Cforall or CFA).
12Exception handling provides alternative dynamic inter-function control flow.
13There are two forms of exception handling covered in this thesis:
14termination, which acts as a multi-level return,
15and resumption, which is a dynamic function call.
16Note, termination exception handling is so common it is often assumed to be the only form.
17Lesser know derivations of inter-function control flow are continuation passing in Lisp~\cite{CommonLisp}.
18
19Termination exception handling allows control to return to any previous
20function on the stack directly, skipping any functions between it and the
21current function.
22\begin{center}
23\input{callreturn}
24\end{center}
25
26Resumption exception handling calls a function, but asks the functions on the
27stack what function that is.
28\todo{Add a diagram showing control flow for resumption.}
29
30Although a powerful feature, exception handling tends to be complex to set up
31and expensive to use
32so they are often limited to unusual or ``exceptional" cases.
33The classic example of this is error handling, exceptions can be used to
34remove error handling logic from the main execution path and while paying
35most of the cost only when the error actually occurs.
36
37% Overview of exceptions in Cforall.
38
39\PAB{You need section titles here. Don't take them out.}
40
41\section{Thesis Overview}
42
43This thesis goes over the design and implementation of the exception handling
44mechanism (EHM) of
45\CFA (pernounced sea-for-all and may be written Cforall or CFA).
46%This thesis describes the design and implementation of the \CFA EHM.
47The \CFA EHM implements all of the common exception features (or an
48equivalent) found in most other EHMs and adds some features of its own.
49The design of all the features had to be adapted to \CFA's feature set as
50some of the underlying tools used to implement and express exception handling
51in other languages are absent in \CFA.
52Still the resulting syntax resembles that of other languages:
53\begin{cfa}
54try {
55        ...
56        T * object = malloc(request_size);
57        if (!object) {
58                throw OutOfMemory{fixed_allocation, request_size};
59        }
60        ...
61} catch (OutOfMemory * error) {
62        ...
63}
64\end{cfa}
65
66% A note that yes, that was a very fast overview.
67The design and implementation of all of \CFA's EHM's features are
68described in detail throughout this thesis, whether they are a common feature
69or one unique to \CFA.
70
71% The current state of the project and what it contributes.
72All of these features have been implemented in \CFA, along with
73a suite of test cases as part of this project.
74The implementation techniques are generally applicable in other programming
75languages and much of the design is as well.
76Some parts of the EHM use other features unique to \CFA and these would be
77harder to replicate in other programming languages.
78
79\section{Background}
80
81% Talk about other programming languages.
82Some existing programming languages that include EHMs/exception handling
83include C++, Java and Python. All three examples focus on termination
84exceptions which unwind the stack as part of the
85Exceptions also can replace return codes and return unions.
86In functional languages will also sometimes fold exceptions into monads.
87
88\PAB{You must demonstrate knowledge of background material here.
89It should be at least a full page.}
90
91\section{Contributions}
92
93The contributions of this work are:
94\begin{enumerate}
95\item Designing \CFA's exception handling mechanism, adapting designs from
96other programming languages and the creation of new features.
97\item Implementing stack unwinding and the EHM in \CFA, including updating
98the compiler and the run-time environment.
99\item Designed and implemented a prototype virtual system.
100% I think the virtual system and per-call site default handlers are the only
101% "new" features, everything else is a matter of implementation.
102\end{enumerate}
103
104\todo{I can't figure out a good lead-in to the overview.}
105Covering the existing \CFA features in \autoref{c:existing}.
106Then the new features are introduce in \autoref{c:features}, explaining their
107usage and design.
108That is followed by the implementation of those features in
109\autoref{c:implement}.
110% Future Work \autoref{c:future}
Note: See TracBrowser for help on using the repository browser.