Changeset 814f87d

Sep 23, 2021, 3:36:04 PM (3 weeks ago)
Andrew Beach <ajbeach@…>

Andrew MMath: Updated thesis with Yizhou Zhang's feedback.

5 edited


  • doc/theses/andrew_beach_MMath/features.tex

    r75c7252 r814f87d  
    908908After a coroutine stack is unwound, control returns to the @resume@ function
    909909that most recently resumed it. @resume@ reports a
    910 @CoroutineCancelled@ exception, which contains a references to the cancelled
     910@CoroutineCancelled@ exception, which contains a reference to the cancelled
    911911coroutine and the exception used to cancel it.
    912912The @resume@ function also takes the \defaultResumptionHandler{} from the
  • doc/theses/andrew_beach_MMath/implement.tex

    r75c7252 r814f87d  
    414414of a function's state with @setjmp@ and restoring that snapshot with
    415415@longjmp@. This approach bypasses the need to know stack details by simply
    416 reseting to a snapshot of an arbitrary but existing function frame on the
     416resetting to a snapshot of an arbitrary but existing function frame on the
    417417stack. It is up to the programmer to ensure the snapshot is valid when it is
    418418reset and that all required cleanup from the unwound stacks is performed.
    419 This approach is fragile and requires extra work in the surrounding code.
     419Because it does not automate or check any of this cleanup,
     420it can be easy to make mistakes and always must be handled manually.
    421422With respect to the extra work in the surrounding code,
    435436library that provides tools for stack walking, handler execution, and
    436437unwinding. What follows is an overview of all the relevant features of
    437 libunwind needed for this work, and how \CFA uses them to implement exception
    438 handling.
     438libunwind needed for this work.
     439Following that is the description of the \CFA code that uses libunwind
     440to implement termination.
    440442\subsection{libunwind Usage}
  • doc/theses/andrew_beach_MMath/intro.tex

    r75c7252 r814f87d  
    220220unwinding the stack like in termination exception
    222 Go's panic through is very similar to a termination, except it only supports
     222Go's panic though is very similar to a termination, except it only supports
    223223a catch-all by calling \code{Go}{recover()}, simplifying the interface at
    224224the cost of flexibility.\cite{Go:2021}
    265265This pattern is very popular in any functional or semi-functional language
    266266with primitive support for tagged unions (or algebraic data types).
    267 % We need listing Rust/rust to format code snippets from it.
    268 % Rust's \code{rust}{Result<T, E>}
     267Return unions can also be expressed as monads (evaluation in a context)
     268and often are in languages with special syntax for monadic evaluation,
     269such as Haskell's \code{haskell}{do} blocks.
    269271The main advantage is that an arbitrary object can be used to represent an
    270272error, so it can include a lot more information than a simple error code.
    272274execution, and if there aren't primitive tagged unions proper, usage can be
    273275hard to enforce.
     276% We need listing Rust/rust to format code snippets from it.
     277% Rust's \code{rust}{Result<T, E>}
     279Return unions as monads will result in the same code, but can hide most
     280of the work to propagate errors in simple cases. The code to actually handle
     281the errors, or to interact with other monads (a common case in these
     282languages) still has to be written by hand.
    275284\item\emph{Handler Functions}:
  • doc/theses/andrew_beach_MMath/performance.tex

    r75c7252 r814f87d  
    3737resumption exceptions. Even the older programming languages with resumption
    3838seem to be notable only for having resumption.
     39On the other hand, the functional equivalents to resumption are too new.
     40There does not seem to be any standard implementations in well-known
     41languages, so far they seem confined to extensions and research languages.
     42% There was some maybe interesting comparison to an OCaml extension
     43% but I'm not sure how to get that working if it is interesting.
    3944Instead, resumption is compared to its simulation in other programming
    4045languages: fixup functions that are explicitly passed into a function.
  • doc/theses/andrew_beach_MMath/uw-ethesis.bib

    r75c7252 r814f87d  
    5050    author={The Rust Team},
    5151    key={Rust Panic Macro},
    52     howpublished={\href{}{https://\\-std/\-panic/\-index.html}},
     52    howpublished={\href{}{https://\\-std/\-macro.panic.html}},
    5353    addendum={Accessed 2021-08-31},
Note: See TracChangeset for help on using the changeset viewer.