Changeset 6aa84e0 for doc/theses/andrew_beach_MMath
- Timestamp:
- Sep 20, 2021, 11:46:19 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 6cc87c0
- Parents:
- 432bffe
- Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/existing.tex
r432bffe r6aa84e0 49 49 asterisk (@*@) is replaced with a ampersand (@&@); 50 50 this includes cv-qualifiers (\snake{const} and \snake{volatile}) 51 %\todo{Should I go into even more detail on cv-qualifiers.}52 51 and multiple levels of reference. 53 52 -
doc/theses/andrew_beach_MMath/features.tex
r432bffe r6aa84e0 129 129 \section{Virtuals} 130 130 \label{s:virtuals} 131 %\todo{Maybe explain what "virtual" actually means.} 131 A common feature in many programming languages is a tool to pair code 132 (behaviour) with data. 133 In \CFA this is done with the virtual system, 134 which allow type information to be abstracted away, recovered and allow 135 operations to be performed on the abstract objects. 136 132 137 Virtual types and casts are not part of \CFA's EHM nor are they required for 133 138 an EHM. … … 488 493 Since it is so general, a more specific handler can be defined, 489 494 overriding the default behaviour for the specific exception types. 490 %\todo{Examples?} 495 496 For example, consider an error reading a configuration file. 497 This is most likely a problem with the configuration file @config_error@, 498 but the function could have been passed the wrong file name @arg_error@. 499 In this case the function could raise one exception and then, if it is 500 unhandled, raise the other. 501 This is not usual behaviour for either exception so changing the 502 default handler will be done locally: 503 \begin{cfa} 504 { 505 void defaultTerminationHandler(config_error &) { 506 throw (arg_error){arg_vt}; 507 } 508 throw (config_error){config_vt}; 509 } 510 \end{cfa} 491 511 492 512 \subsection{Resumption} … … 551 571 the just handled exception came from, and continues executing after it, 552 572 not after the try statement. 553 %\todo{Examples?} 573 574 For instance, a resumption used to send messages to the logger may not 575 need to be handled at all. Putting the following default handler 576 at the global scope can make handling the exception optional by default. 577 \begin{cfa} 578 void defaultResumptionHandler(log_message &) { 579 // Nothing, it is fine not to handle logging. 580 } 581 // ... No change at raise sites. ... 582 throwResume (log_message){strlit_log, "Begin event processing."} 583 \end{cfa} 554 584 555 585 \subsubsection{Resumption Marking} -
doc/theses/andrew_beach_MMath/implement.tex
r432bffe r6aa84e0 50 50 The problem is that a type ID may appear in multiple TUs that compose a 51 51 program (see \autoref{ss:VirtualTable}), so the initial solution would seem 52 to be make it external in each translation unit. Ho vever, the type ID must52 to be make it external in each translation unit. However, the type ID must 53 53 have a declaration in (exactly) one of the TUs to create the storage. 54 54 No other declaration related to the virtual type has this property, so doing … … 167 167 \subsection{Virtual Table} 168 168 \label{ss:VirtualTable} 169 %\todo{Clarify virtual table type vs. virtual table instance.}170 169 Each virtual type has a virtual table type that stores its type ID and 171 170 virtual members. 172 Each virtual type instance is bound to a table instance that is filled with 173 the values of virtual members. 174 Both the layout of the fields and their value are decided by the rules given 171 An instance of a virtual type is bound to a virtual table instance, 172 which have the values of the virtual members. 173 Both the layout of the fields (in the virtual table type) 174 and their value (in the virtual table instance) are decided by the rules given 175 175 below. 176 176 -
doc/theses/andrew_beach_MMath/intro.tex
r432bffe r6aa84e0 44 44 \input{termhandle.pstex_t} 45 45 \end{center} 46 %\todo{What does the right half of termination.fig mean?}46 \todo*{Can I make the new diagrams fit the old style?} 47 47 48 48 Resumption exception handling searches the stack for a handler and then calls -
doc/theses/andrew_beach_MMath/performance.tex
r432bffe r6aa84e0 312 312 \CFA, \Cpp and Java. 313 313 % To be exact, the Match All and Match None cases. 314 %\todo{Not true in Python.} 315 The most likely explanation is that, since exceptions 316 are rarely considered to be the common case, the more optimized languages 317 make that case expensive to improve other cases. 314 The most likely explination is that, 315 the generally faster languages have made ``common cases fast" at the expense 316 of the rarer cases. Since exceptions are considered rare, they are made 317 expensive to help speed up common actions, such as entering and leaving try 318 statements. 319 Python on the other hand, while generally slower than the other languages, 320 uses exceptions more and has not scarified their performance. 318 321 In addition, languages with high-level representations have a much 319 322 easier time scanning the stack as there is less to decode.
Note: See TracChangeset
for help on using the changeset viewer.