Changeset b6749fd for doc/theses/andrew_beach_MMath/future.tex
- Timestamp:
- Jun 15, 2021, 11:34:30 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6f8c46d
- Parents:
- 3720c9aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/future.tex
r3720c9aa rb6749fd 7 7 that I had to workaround while building an exception handling system largely in 8 8 the \CFA language (some C components). The following are a few of these 9 issues, and once implemented/fixed, how th iswould affect the exception system.9 issues, and once implemented/fixed, how they would affect the exception system. 10 10 \begin{itemize} 11 11 \item … … 13 13 hand-crafted assembly statements. These sections must be ported by hand to 14 14 support more hardware architectures, such as the ARM processor. 15 \PAB{I think this is a straw-man problem because the hand-coded assembler code 16 has to be generated somewhere, and that somewhere is hand-coded.} 15 17 \item 16 18 Due to a type-system problem, the catch clause cannot bind the exception to a 17 19 reference instead of a pointer. Since \CFA has a very general reference 18 20 capability, programmers will want to use it. Once fixed, this capability should 19 result in little or no change in the exception system .21 result in little or no change in the exception system but simplify usage. 20 22 \item 21 23 Termination handlers cannot use local control-flow transfers, \eg by @break@, … … 28 30 There is no detection of colliding unwinds. It is possible for clean-up code 29 31 run during an unwind to trigger another unwind that escapes the clean-up code 30 itself ; such asa termination exception caught further down the stack or a31 cancellation. There do exist ways to handle this but currently they are not32 even detected and the first unwind will simply be forgotten, often leaving33 it in a bad state. 32 itself, \eg, a termination exception caught further down the stack or a 33 cancellation. There do exist ways to handle this issue, but currently they are not 34 even detected and the first unwind is simply dropped, often leaving 35 it in a bad state. \Cpp terminates the program in this case, and Java picks the ... 34 36 \item 35 37 Also the exception system did not have a lot of time to be tried and tested. … … 41 43 The virtual system should be completed. It was not supposed to be part of this 42 44 project, 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 but45 minimal work is done. A draft for a complete virtual system is available but 44 46 it is not finalized. A future \CFA project is to complete that work and then 45 47 update the exception system that uses the current version. … … 67 69 bad software engineering. 68 70 69 Non-local/concurrent r equires more coordination between the concurrency system71 Non-local/concurrent raise requires more coordination between the concurrency system 70 72 and the exception system. Many of the interesting design decisions centre 71 around masking (controlling which exceptions may be thrown at a stack). It73 around masking, \ie controlling which exceptions may be thrown at a stack. It 72 74 would likely require more of the virtual system and would also effect how 73 75 default handlers are set. … … 85 87 86 88 \section{Checked Exceptions} 87 Checked exceptions make exceptions part of a function's type by adding the89 Checked exceptions make exceptions part of a function's type by adding an 88 90 exception signature. An exception signature must declare all checked 89 exceptions that could prop ogate from the function (either because they were91 exceptions that could propagate from the function (either because they were 90 92 raised inside the function or came from a sub-function). This improves safety 91 93 by making sure every checked exception is either handled or consciously 92 94 passed on. 93 95 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 96 However checked exceptions were never seriously considered for this project because 97 they have significant usability and reuse trade-offs in 99 98 exchange for the increased safety. 100 101 99 These trade-offs are most problematic when trying to pass exceptions through 102 100 higher-order functions from the functions the user passed into the 103 101 higher-order function. There are no well known solutions to this problem 104 that were s tatifactory for \CFA (which carries some of C's flexability105 over safety design) so one would have to be researched and developed.102 that were satisfactory for \CFA (which carries some of C's flexibility 103 over safety design) so additional research is needed. 106 104 107 Follow-up work might add checked exceptions to\CFA, possibly using108 polymorphic exception signatures, a form of tunneling\cite{Zhang19} or105 Follow-up work might find a compromise design for checked exceptions in \CFA, possibly using 106 polymorphic exception signatures, a form of tunneling\cite{Zhang19}, or 109 107 checked and unchecked raises. 110 108 … … 150 148 For instance, resumption could be extended to cover this use by allowing local 151 149 control 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 approach153 means there is no notify raise, but because \CFA does not have exception154 signatures, a termination canbe thrown from within any resumption handler so155 there is already a way to do mimic this in existing \CFA.150 transition as there are stack frames that have to be removed back to the resumption handler. This approach 151 means no special statement is required in the handler to continue after it. 152 Currently, \CFA allows a termination exception to be thrown from within any resumption handler so 153 there is already a way to partially mimic signal exceptions. 156 154 157 155 % Maybe talk about the escape; and escape CONTROL_STMT; statements or how
Note: See TracChangeset
for help on using the changeset viewer.