Ignore:
Timestamp:
Jun 15, 2021, 4:46:07 PM (3 years ago)
Author:
m3zulfiq <m3zulfiq@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5e2ed05
Parents:
cb5c392 (diff), 45fde9f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rcb5c392 r27c9767  
    77that I had to workaround while building an exception handling system largely in
    88the \CFA language (some C components).  The following are a few of these
    9 issues, and once implemented/fixed, how this would affect the exception system.
     9issues, and once implemented/fixed, how they would affect the exception system.
    1010\begin{itemize}
    1111\item
     
    1313hand-crafted assembly statements. These sections must be ported by hand to
    1414support more hardware architectures, such as the ARM processor.
     15\PAB{I think this is a straw-man problem because the hand-coded assembler code
     16has to be generated somewhere, and that somewhere is hand-coded.}
    1517\item
    1618Due to a type-system problem, the catch clause cannot bind the exception to a
    1719reference instead of a pointer. Since \CFA has a very general reference
    1820capability, programmers will want to use it. Once fixed, this capability should
    19 result in little or no change in the exception system.
     21result in little or no change in the exception system but simplify usage.
    2022\item
    2123Termination handlers cannot use local control-flow transfers, \eg by @break@,
     
    2830There is no detection of colliding unwinds. It is possible for clean-up code
    2931run during an unwind to trigger another unwind that escapes the clean-up code
    30 itself; such as a termination exception caught further down the stack or a
    31 cancellation. There do exist ways to handle this but currently they are not
    32 even detected and the first unwind will simply be forgotten, often leaving
    33 it in a bad state.
     32itself, \eg, a termination exception caught further down the stack or a
     33cancellation. There do exist ways to handle this issue, but currently they are not
     34even detected and the first unwind is simply dropped, often leaving
     35it in a bad state. \Cpp terminates the program in this case, and Java picks the ...
    3436\item
    3537Also the exception system did not have a lot of time to be tried and tested.
     
    4143The virtual system should be completed. It was not supposed to be part of this
    4244project, but was thrust upon it to do exception inheritance; hence, only
    43 minimal work was done. A draft for a complete virtual system is available but
     45minimal work is done. A draft for a complete virtual system is available but
    4446it is not finalized.  A future \CFA project is to complete that work and then
    4547update the exception system that uses the current version.
     
    6769bad software engineering.
    6870
    69 Non-local/concurrent requires more coordination between the concurrency system
     71Non-local/concurrent raise requires more coordination between the concurrency system
    7072and the exception system. Many of the interesting design decisions centre
    71 around masking (controlling which exceptions may be thrown at a stack). It
     73around masking, \ie controlling which exceptions may be thrown at a stack. It
    7274would likely require more of the virtual system and would also effect how
    7375default handlers are set.
     
    8587
    8688\section{Checked Exceptions}
    87 Checked exceptions make exceptions part of a function's type by adding the
     89Checked exceptions make exceptions part of a function's type by adding an
    8890exception signature. An exception signature must declare all checked
    89 exceptions that could propogate from the function (either because they were
     91exceptions that could propagate from the function (either because they were
    9092raised inside the function or came from a sub-function). This improves safety
    9193by making sure every checked exception is either handled or consciously
    9294passed on.
    9395
    94 However checked exceptions were never seriously considered for this project
    95 for two reasons. The first is due to time constraints, even copying an
    96 existing checked exception system would be pushing the remaining time and
    97 trying to address the second problem would take even longer. The second
    98 problem is that checked exceptions have some real usability trade-offs in
     96However checked exceptions were never seriously considered for this project because
     97they have significant usability and reuse trade-offs in
    9998exchange for the increased safety.
    100 
    10199These trade-offs are most problematic when trying to pass exceptions through
    102100higher-order functions from the functions the user passed into the
    103101higher-order function. There are no well known solutions to this problem
    104 that were statifactory for \CFA (which carries some of C's flexability
    105 over safety design) so one would have to be researched and developed.
     102that were satisfactory for \CFA (which carries some of C's flexibility
     103over safety design) so additional research is needed.
    106104
    107 Follow-up work might add checked exceptions to \CFA, possibly using
    108 polymorphic exception signatures, a form of tunneling\cite{Zhang19} or
     105Follow-up work might find a compromise design for checked exceptions in \CFA, possibly using
     106polymorphic exception signatures, a form of tunneling\cite{Zhang19}, or
    109107checked and unchecked raises.
    110108
     
    150148For instance, resumption could be extended to cover this use by allowing local
    151149control flow out of it. This approach would require an unwind as part of the
    152 transition as there are stack frames that have to be removed.  This approach
    153 means there is no notify raise, but because \CFA does not have exception
    154 signatures, a termination can be thrown from within any resumption handler so
    155 there is already a way to do mimic this in existing \CFA.
     150transition as there are stack frames that have to be removed back to the resumption handler.  This approach
     151means no special statement is required in the handler to continue after it.
     152Currently, \CFA allows a termination exception to be thrown from within any resumption handler so
     153there is already a way to partially mimic signal exceptions.
    156154
    157155% Maybe talk about the escape; and escape CONTROL_STMT; statements or how
Note: See TracChangeset for help on using the changeset viewer.