Changeset 5a40e4e for doc/theses/andrew_beach_MMath/future.tex
- Timestamp:
- Sep 9, 2021, 3:56:32 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- d0b9247
- Parents:
- dd1cc02 (diff), d8d512e (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. - File:
-
- 1 edited
-
doc/theses/andrew_beach_MMath/future.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/future.tex
rdd1cc02 r5a40e4e 2 2 \label{c:future} 3 3 4 The following discussion covers both possible interesting research 5 that could follow from this work as long as simple implementation 6 improvements. 7 4 8 \section{Language Improvements} 5 \todo{Future/Language Improvements seems to have gotten mixed up. It is 6 presented as ``waiting on language improvements" but really its more 7 non-research based impovements.} 9 8 10 \CFA is a developing programming language. As such, there are partially or 9 unimplemented features of the language (including several broken components) 10 that I had to workaround while building an exception handling system largely in 11 the \CFA language (some C components). The following are a few of these 12 issues, and once implemented/fixed, how they would affect the exception system. 11 unimplemented features (including several broken components) 12 that I had to workaround while building the EHM largely in 13 the \CFA language (some C components). Below are a few of these issues 14 and how implementing/fixing them would affect the EHM. 15 In addition there are some simple improvements that had no interesting 16 research attached to them but would make using the language easier. 13 17 \begin{itemize} 14 \item15 The implementation of termination is not portable because it includes16 hand-crafted assembly statements.17 The existing compilers cannot translate that for other platforms and those18 sections must be ported by hand to19 support more hardware architectures, such as the ARM processor.20 18 \item 21 19 Due to a type-system problem, the catch clause cannot bind the exception to a … … 24 22 result in little or no change in the exception system but simplify usage. 25 23 \item 24 The @copy@ function in the exception virtual table is an adapter to address 25 some limitations in the \CFA copy constructor. If the copy constructor is 26 improved it can be used directly without the adapter. 27 \item 26 28 Termination handlers cannot use local control-flow transfers, \eg by @break@, 27 29 @return@, \etc. The reason is that current code generation hoists a handler 28 30 into a nested function for convenience (versus assemble-code generation at the 29 @try@ statement). Hence, when the handler runs, its code is not in the lexical 30 scope of the @try@ statement, where the local control-flow transfers are 31 meaningful. 31 try statement). Hence, when the handler runs, it can still access local 32 variables in the lexical scope of the try statement. Still, it does mean 33 that seemingly local control flow is not in fact local and crosses a function 34 boundary. 35 Making the termination handlers code within the surrounding 36 function would remove this limitation. 37 % Try blocks are much more difficult to do practically (requires our own 38 % assembly) and resumption handlers have some theoretical complexity. 32 39 \item 33 40 There is no detection of colliding unwinds. It is possible for clean-up code 34 41 run during an unwind to trigger another unwind that escapes the clean-up code 35 42 itself; such as a termination exception caught further down the stack or a 36 cancellation. There do exist ways to handle this but currently they are not37 even detectedand the first unwind will simply be forgotten, often leaving43 cancellation. There do exist ways to handle this case, but currently there is 44 no detection and the first unwind will simply be forgotten, often leaving 38 45 it in a bad state. 39 46 \item 40 Also the exception system did not have a lot of time to be tried and tested.41 So just letting people use the exception system more will reveal new42 quality of life upgrades that can be made with time.47 Finally, the exception system has not had a lot of programmer testing. 48 More time with encouraged usage will reveal new 49 quality of life upgrades that can be made. 43 50 \end{itemize} 44 51 … … 47 54 project, but was thrust upon it to do exception inheritance; hence, only 48 55 minimal work is done. A draft for a complete virtual system is available but 49 it is not finalized.A future \CFA project is to complete that work and then56 not finalized. A future \CFA project is to complete that work and then 50 57 update the exception system that uses the current version. 51 58 … … 53 60 exception traits. The most important one is an assertion to check one virtual 54 61 type is a child of another. This check precisely captures many of the 55 correctness requirements. 62 current ad-hoc correctness requirements. 63 64 Other features of the virtual system could also remove some of the 65 special cases around exception virtual tables, such as the generation 66 of the @msg@ function, could be removed. 56 67 57 68 The full virtual system might also include other improvement like associated 58 69 types to allow traits to refer to types not listed in their header. This 59 70 feature allows exception traits to not refer to the virtual-table type 60 explicitly, removing the need for the current interface macros. 71 explicitly, removing the need for the current interface macros, 72 such as @EHM_IS_EXCEPTION@. 61 73 62 74 \section{Additional Raises} … … 74 86 Non-local/concurrent raise requires more 75 87 coordination between the concurrency system 76 and the exception system. Many of the interesting design decisions cent re88 and the exception system. Many of the interesting design decisions center 77 89 around masking, \ie controlling which exceptions may be thrown at a stack. It 78 90 would likely require more of the virtual system and would also effect how … … 93 105 Checked exceptions make exceptions part of a function's type by adding an 94 106 exception signature. An exception signature must declare all checked 95 exceptions that could propagate from the function (either because they were96 raised inside the function or came from a sub-function ). This improves safety107 exceptions that could propagate from the function, either because they were 108 raised inside the function or came from a sub-function. This improves safety 97 109 by making sure every checked exception is either handled or consciously 98 110 passed on. 99 111 100 112 However checked exceptions were never seriously considered for this project 101 because they have significant trade-offs in usab lity and code reuse in113 because they have significant trade-offs in usability and code reuse in 102 114 exchange for the increased safety. 103 115 These trade-offs are most problematic when trying to pass exceptions through … … 129 141 not support a successful-exiting stack-search without doing an unwind. 130 142 Workarounds are possible but awkward. Ideally an extension to libunwind could 131 be made, but that would either require separate maintenance or gain enough132 support to have it folded into the standard.143 be made, but that would either require separate maintenance or gaining enough 144 support to have it folded into the official library itself. 133 145 134 146 Also new techniques to skip previously searched parts of the stack need to be … … 158 170 to leave the handler. 159 171 Currently, mimicking this behaviour in \CFA is possible by throwing a 160 termination inside a resumption handler.172 termination exception inside a resumption handler. 161 173 162 174 % Maybe talk about the escape; and escape CONTROL_STMT; statements or how
Note:
See TracChangeset
for help on using the changeset viewer.