- Timestamp:
- Jun 16, 2021, 10:44:22 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- edebbf7
- Parents:
- b51e389c
- Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/existing.tex
rb51e389c r6071efc 10 10 11 11 Only those \CFA features pertaining to this thesis are discussed. 12 Also, only new features of \CFA will be discussed, a basicfamiliarity with12 Also, only new features of \CFA will be discussed, a familiarity with 13 13 C or C-like languages is assumed. 14 14 … … 88 88 Operator uses are translated into function calls using these names. 89 89 These names are created by taking the operator symbols and joining them with 90 @?@ where the arguments wouldgo.90 @?@s to show where the arguments go. 91 91 For example, 92 92 infixed multiplication is @?*?@ while prefix dereference is @*?@. … … 95 95 96 96 \begin{cfa} 97 int ?+?(point a, point b) { return point{a.x + b.x, a.y + b.y}; }97 point ?+?(point a, point b) { return point{a.x + b.x, a.y + b.y}; } 98 98 bool ?==?(point a, point b) { return a.x == b.x && a.y == b.y; } 99 99 { -
doc/theses/andrew_beach_MMath/features.tex
rb51e389c r6071efc 13 13 \subsection{Raise / Handle} 14 14 An exception operation has two main parts: raise and handle. 15 These terms are sometimes alsoknown as throw and catch but this work uses15 These terms are sometimes known as throw and catch but this work uses 16 16 throw/catch as a particular kind of raise/handle. 17 17 These are the two parts that the user writes and may … … 37 37 Only raises inside the guarded region and raising exceptions that match the 38 38 label can be handled by a given handler. 39 Different EHMs use different rules to pick a handler,40 if multiple handlers could be usedsuch as ``best match" or ``first found".39 If multiple handlers could can handle an exception, 40 EHMs will define a rule to pick one, such as ``best match" or ``first found". 41 41 42 42 The @try@ statements of \Cpp, Java and Python are common examples. All three … … 74 74 case when stack unwinding is involved. 75 75 76 If a matching handler is not guarant ied to be found, the EHM needs a76 If a matching handler is not guaranteed to be found, the EHM needs a 77 77 different course of action for the case where no handler matches. 78 78 This situation only occurs with unchecked exceptions as checked exceptions … … 105 105 106 106 \subsection{Completion} 107 After the handler has finished the entire exception operation has to complete107 After the handler has finished, the entire exception operation has to complete 108 108 and continue executing somewhere else. This step is usually simple, 109 109 both logically and in its implementation, as the installation of the handler … … 126 126 Virtual types and casts are not part of \CFA's EHM nor are they required for 127 127 any EHM. 128 However, it is one of the best ways to support an exception hiera chy128 However, it is one of the best ways to support an exception hierarchy 129 129 is via a virtual hierarchy and dispatch system. 130 130 … … 441 441 There is a global \defaultResumptionHandler{} is polymorphic over all 442 442 resumption exceptions and preforms a termination throw on the exception. 443 The \defaultTerminationHandler{} can be overrid en by providing a new443 The \defaultTerminationHandler{} can be overridden by providing a new 444 444 function that is a better match. 445 445 … … 582 582 Two things can expose differences between these cases. 583 583 584 One is the exist ance of multiple handlers on a single try statement.584 One is the existence of multiple handlers on a single try statement. 585 585 A reraise skips all later handlers on this try statement but a conditional 586 586 catch does not. … … 588 588 implicitly skipped, with a conditional catch they are not. 589 589 Still, they are equivalently powerful, 590 both can be used two mimic kthe behaviour of the other,590 both can be used two mimic the behaviour of the other, 591 591 as reraise can pack arbitrary code in the handler and conditional catches 592 592 can put arbitrary code in the predicate. 593 % I was struggling with a long expl ination about some simple solutions,593 % I was struggling with a long explanation about some simple solutions, 594 594 % like repeating a condition on later handlers, and the general solution of 595 595 % merging everything together. I don't think it is useful though unless its -
doc/theses/andrew_beach_MMath/intro.tex
rb51e389c r6071efc 4 4 This thesis goes over the design and implementation of the exception handling 5 5 mechanism (EHM) of 6 \CFA (pernounced sea-for-all and may be written Cforall or CFA). 6 \CFA (pronounced sea-for-all and may be written Cforall or CFA). 7 \CFA is a new programming language that extends C, that maintains 8 backwards-compatibility while introducing modern programming features. 9 Adding exception handling to \CFA gives it new ways to handle errors and 10 make other large control-flow jumps. 7 11 8 12 % Now take a step back and explain what exceptions are generally. … … 27 31 \end{center} 28 32 29 Resumption exception handling calls a function, but asks the functions on the30 stack what function that is.33 Resumption exception handling seaches the stack for a handler and then calls 34 it without adding or removing any other stack frames. 31 35 \todo{Add a diagram showing control flow for resumption.} 32 36 … … 77 81 exceptions which unwind the stack as part of the 78 82 Exceptions also can replace return codes and return unions. 79 In functional languages will also sometimes fold exceptions into monads.80 83 81 84 The contributions of this work are:
Note: See TracChangeset
for help on using the changeset viewer.