Changeset 6071efc for doc


Ignore:
Timestamp:
Jun 16, 2021, 10:44:22 AM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
edebbf7
Parents:
b51e389c
Message:

Andrew MMath: Update the first three chapters using Colby's comments.

Location:
doc/theses/andrew_beach_MMath
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/existing.tex

    rb51e389c r6071efc  
    1010
    1111Only those \CFA features pertaining to this thesis are discussed.
    12 Also, only new features of \CFA will be discussed, a basic familiarity with
     12Also, only new features of \CFA will be discussed, a familiarity with
    1313C or C-like languages is assumed.
    1414
     
    8888Operator uses are translated into function calls using these names.
    8989These names are created by taking the operator symbols and joining them with
    90 @?@ where the arguments would go.
     90@?@s to show where the arguments go.
    9191For example,
    9292infixed multiplication is @?*?@ while prefix dereference is @*?@.
     
    9595
    9696\begin{cfa}
    97 int ?+?(point a, point b) { return point{a.x + b.x, a.y + b.y}; }
     97point ?+?(point a, point b) { return point{a.x + b.x, a.y + b.y}; }
    9898bool ?==?(point a, point b) { return a.x == b.x && a.y == b.y; }
    9999{
  • doc/theses/andrew_beach_MMath/features.tex

    rb51e389c r6071efc  
    1313\subsection{Raise / Handle}
    1414An exception operation has two main parts: raise and handle.
    15 These terms are sometimes also known as throw and catch but this work uses
     15These terms are sometimes known as throw and catch but this work uses
    1616throw/catch as a particular kind of raise/handle.
    1717These are the two parts that the user writes and may
     
    3737Only raises inside the guarded region and raising exceptions that match the
    3838label can be handled by a given handler.
    39 Different EHMs use different rules to pick a handler,
    40 if multiple handlers could be used such as ``best match" or ``first found".
     39If multiple handlers could can handle an exception,
     40EHMs will define a rule to pick one, such as ``best match" or ``first found".
    4141
    4242The @try@ statements of \Cpp, Java and Python are common examples. All three
     
    7474case when stack unwinding is involved.
    7575
    76 If a matching handler is not guarantied to be found, the EHM needs a
     76If a matching handler is not guaranteed to be found, the EHM needs a
    7777different course of action for the case where no handler matches.
    7878This situation only occurs with unchecked exceptions as checked exceptions
     
    105105
    106106\subsection{Completion}
    107 After the handler has finished the entire exception operation has to complete
     107After the handler has finished, the entire exception operation has to complete
    108108and continue executing somewhere else. This step is usually simple,
    109109both logically and in its implementation, as the installation of the handler
     
    126126Virtual types and casts are not part of \CFA's EHM nor are they required for
    127127any EHM.
    128 However, it is one of the best ways to support an exception hierachy
     128However, it is one of the best ways to support an exception hierarchy
    129129is via a virtual hierarchy and dispatch system.
    130130
     
    441441There is a global \defaultResumptionHandler{} is polymorphic over all
    442442resumption exceptions and preforms a termination throw on the exception.
    443 The \defaultTerminationHandler{} can be overriden by providing a new
     443The \defaultTerminationHandler{} can be overridden by providing a new
    444444function that is a better match.
    445445
     
    582582Two things can expose differences between these cases.
    583583
    584 One is the existance of multiple handlers on a single try statement.
     584One is the existence of multiple handlers on a single try statement.
    585585A reraise skips all later handlers on this try statement but a conditional
    586586catch does not.
     
    588588implicitly skipped, with a conditional catch they are not.
    589589Still, they are equivalently powerful,
    590 both can be used two mimick the behaviour of the other,
     590both can be used two mimic the behaviour of the other,
    591591as reraise can pack arbitrary code in the handler and conditional catches
    592592can put arbitrary code in the predicate.
    593 % I was struggling with a long explination about some simple solutions,
     593% I was struggling with a long explanation about some simple solutions,
    594594% like repeating a condition on later handlers, and the general solution of
    595595% merging everything together. I don't think it is useful though unless its
  • doc/theses/andrew_beach_MMath/intro.tex

    rb51e389c r6071efc  
    44This thesis goes over the design and implementation of the exception handling
    55mechanism (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
     8backwards-compatibility while introducing modern programming features.
     9Adding exception handling to \CFA gives it new ways to handle errors and
     10make other large control-flow jumps.
    711
    812% Now take a step back and explain what exceptions are generally.
     
    2731\end{center}
    2832
    29 Resumption exception handling calls a function, but asks the functions on the
    30 stack what function that is.
     33Resumption exception handling seaches the stack for a handler and then calls
     34it without adding or removing any other stack frames.
    3135\todo{Add a diagram showing control flow for resumption.}
    3236
     
    7781exceptions which unwind the stack as part of the
    7882Exceptions also can replace return codes and return unions.
    79 In functional languages will also sometimes fold exceptions into monads.
    8083
    8184The contributions of this work are:
Note: See TracChangeset for help on using the changeset viewer.