Changeset 02ea981 for doc/theses/mike_brooks_MMath
- Timestamp:
- Oct 16, 2024, 1:31:40 PM (4 weeks ago)
- Branches:
- master
- Children:
- 187be97, e8b5ba4
- Parents:
- 4e0168a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/intro.tex
r4e0168a r02ea981 19 19 Because array layout has contiguous components, subscripting is a computation (some form of pointer arithmetic). 20 20 21 C provides an array as a language feature. 21 22 22 23 \section{Linked list} 23 24 24 A linked-list provides a homogeneous container often with $O(log N)$ /$O(N)$ access to elements using successor and predecessor operations that normally involve pointer chasing.25 A linked-list provides a homogeneous container often with $O(log N)$ or $O(N)$ access to elements using successor and predecessor operations that normally involve pointer chasing. 25 26 Subscripting by value is sometimes available, \eg hash table. 26 27 Linked types are normally dynamically sized by adding/removing nodes using link fields internal or external to the elements (nodes). … … 28 29 otherwise, elements are heap allocated with explicitly/implicitly managed. 29 30 31 C does not provide a linked-list, either as an obvious commonly-accepted library, nor as an outright language feature. 32 C programmers commonly build linked-list behaviours into their bespoke data structures, directly using its language feature of pointers. 30 33 31 34 \section{String} … … 38 41 In some cases, string management is separate from heap management, \ie strings roll their own heap. 39 42 43 The C string type is a user-managed allocation of the language-provided character array, 44 plus the convention of marking its (variable) length by placing the 0-valued control character at the end (``null-terminated''). 45 The C standard library includes many operations for working on this representation. 40 46 41 47 \section{Iterator} … … 90 96 As well, a strong plan for general iteration has been sketched out. 91 97 98 This thesis mainly describes improvements made to the source code of the \CFA compiler and runtime system, 99 available at TODO. 100 101 This work often leverages preexisting xxxxxxxxxx 102 92 103 \subsection{Linked list} 104 105 The linked list is a new runtime library, available as @#include <dlist.hfa>@. 106 The library offers a novel combination of the preexisting \CFA features of: 107 references, inline inheritance, polymorphism and declaration scoping. 108 A programmer's experience of the list datatype within the type system is novel. 109 The list's runtime representation follows the established design pattern of intrusion. 110 This thesis includes a performance evaluation that shows 111 the list performing comparably with other C-family intrusive lists, 112 and notably better than the \CC standard list. 93 113 94 114 \subsection{Array} 95 115 116 This work's array improvements are 117 \begin{enumerate}[leftmargin=*] 118 \item 119 subtle changes to the typing rules for the C array, 120 \item 121 a new \CFA language construct for a type-system managed array length, and 122 \item 123 a new standard-library array type, available as @#include <array.hfa>@. 124 \end{enumerate} 125 The new array type, enabled by the earlier features, defines an array with 126 guaranteed runtime bound checks (often optimizer-removable) and 127 implicit (guaranteed accurate) inter-function length communication. 128 Leveraging the preexisting \CFA type system to achieve 129 this length-related type checking is an original contribution. 130 131 Furthermore, the new array incorporates multidimensional capabilities 132 typical of scientific/machine-learning languages, 133 made to coexist with the C ``raw-memory-aware'' tradition in a novel way. 134 96 135 \subsection{String} 97 136 137 The string is a new runtime library, available as @#include <string.hfa>@. 138 The library offers a type whose basic usage is comparable to the \CC @string@ type, 139 including analogous coexistence with raw character pointers. 140 Its implementation, however, follows different princliples, 141 enabling programs to work with strings by value, without incurring excessive copying. 142 Mutability is retained. 143 Substrings are supported, including the ability for overlapping ranges to share edits transparently. 144 Ultimately, this implementation is a case of strings rolling their own heap. 145 146 The string library includes writing and reading strings via the preexsiting \CFA I/O stream library. 147 Enabling transparent reading (of unknown length into a managed allocation) included revision of 148 the stream libarary's existing handling of character arrays. 149 98 150 \subsection{Iterator} 151 152 Some prototyping, available in the \CFA standard library, 153 addresses the infamous \CC bug source of iterator invalidation. 154 A family of iterator styles is presented, with cheap iterators that resist being misused, 155 plus full-featured iterators that observe modifications without becoming invalid. 156 157 Further design within this thesis presents a home for Liskov-style iterators in \CFA. 158 This design extends a preexisting proposal to adapt the \CFA for-each style loop to be more user-pluggable. 159 It also builds upon preexisting \CFA coroutines. 160 It simplifies the work a programmer must do to leverage the suspended-state abstraction.
Note: See TracChangeset
for help on using the changeset viewer.