Ignore:
Timestamp:
Apr 24, 2025, 6:35:41 PM (8 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
6b33e89, f85de47
Parents:
f632bd50
Message:

proofreading intro and background chapters, capitalize section titles, update backtick calls to regular calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/intro.tex

    rf632bd50 rb195498  
    2727
    2828
    29 \section{Linked list}
     29\section{Linked List}
    3030
    3131A 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.
     
    4242hash search table consisting of a key (string) with associated data (@<search.h>@)
    4343\end{itemize}
    44 Because these libraries are simple, awkward to use, and unsafe, C programmers commonly build linked-list behaviours into their bespoke data structures.
     44Because these libraries are simple, awkward to use, and unsafe, C programmers commonly build bespoke linked data-structures.
    4545
    4646
     
    5454In some cases, string management is separate from heap management, \ie strings roll their own heap.
    5555
    56 The C string type requires user storage-management of a language-provided character array.
     56The C string type is just a character array and requires user storage-management to handle varying size.
    5757The character array uses the convention of marking its (variable) array length by placing the 0-valued control character at the end (null-terminated).
    5858The C standard library includes a number of high-level operations for working with this representation.
     59Most of these operations are awkward and error prone.
    5960
    6061
     
    8485While multiple new languages purport to be systems languages replacing C, the reality is that rewriting massive C code-bases is impractical and a non-starter if the new runtime uses garage collection.
    8586Furthermore, new languages must still interact with the underlying C operating system through fragile, type-unsafe, interlanguage-communication.
    86 Switching to \CC is equally impractical as its complex and interdependent type-system (\eg objects, overloading, inheritance, templates) means idiomatic \CC code is difficult to use from C, and C programmers must expend significant effort learning \CC.
     87Switching to \CC is equally impractical as its complex and interdependent type-system (\eg objects, overloading, inheritance, templates) means idiomatic \CC code is difficult to use from C, and C programmers must expend significant effort learning new \CC.
    8788Hence, rewriting and retraining costs for these languages can be prohibitive for companies with a large C software-base (Google, Apple, Microsoft, Amazon, AMD, Nvidia).
    8889
     
    9394However, most programming languages are only partially explained by their standard's manual(s).
    9495When it comes to explaining how C works, the definitive source is the @gcc@ compiler, which is mimicked by other C compilers, such as Clang~\cite{clang}.
    95 Often other C compilers must mimic @gcc@ because a large part of the C library (runtime) system (@glibc@ on Linux) contains @gcc@ features.
     96Often other C compilers \emph{must} mimic @gcc@ because a large part of the C library (runtime) system (@glibc@ on Linux) contains @gcc@ features.
    9697Some key aspects of C need to be explained and understood by quoting from the language reference manual.
    9798However, to illustrate actual program semantics, this thesis constructs multiple small programs whose behaviour exercises a particular point and then confirms the behaviour by running the program using multiple @gcc@ compilers.
     
    100101        \item if the compiler accepts or rejects certain syntax,
    101102        \item prints output to buttress a behavioural claim,
    102         \item or executes without triggering any embedded assertions testing pre/post-assertions or invariants.
     103        \item or fails to trigger embedded assertions testing pre/post-assertions or invariants.
    103104\end{itemize}
    104105These programs are tested across @gcc@ versions 8--14 and clang versions 10--14 running on ARM, AMD, and Intel architectures.
     
    120121Introduce a small number of subtle changes to the typing rules for the C array, while still achieving significant backwards compatibility
    121122\item
    122 Create a new polymorphic mechanism into the \CFA @forall@ clause for specifying array dimension values, similar to a fixed-typed parameter in a \CC \lstinline[language=C++]{template}.
     123Create a new polymorphic mechanism in the \CFA @forall@ clause to specify array dimension values, similar to a fixed-typed parameter in a \CC \lstinline[language=C++]{template}.
    123124\item
    124125Construct a new standard-library array-type, available through @#include <array.hfa>@.
     
    130131
    131132
    132 \subsection{Linked list}
     133\subsection{Linked List}
    133134
    134135The linked list is a new runtime library, available through @#include <dlist.hfa>@.
     
    141142\subsection{String}
    142143
    143 The string is a new runtime library, available through @#include <string.hfa>@.
     144The new string type and its runtime library are available through @#include <string.hfa>@.
    144145The library offers a type where basic usage is comparable to the \CC @string@ type, including analogous coexistence with raw-character pointers.
    145146Its implementation, however, follows different principles, enabling programs to work with strings by value, without incurring excessive copying.
    146147Mutability is retained.
    147148Substrings are supported, including the ability for overlapping ranges to share edits transparently.
    148 Ultimately, the implementation is a set of strings rolled into their own specialized heap.
     149The implementation allows a set of strings to use an optimized, shared, custom heap or to use the regular heap for thread safety.
    149150
    150 The string library includes writing and reading strings via the preexisting \CFA I/O stream library.
    151 Enabling transparent reading (of unknown length into a managed allocation) included revision of the stream library's existing handling of character arrays.
    152 All reasonable stream manipulators are supported, \eg width, justification (left/right), printing characters as their numeric values, and complex input scanning to isolate strings.
     151The string library includes reading and writing strings via the preexisting \CFA I/O stream library.
     152Enabling transparent reading of unknown length strings using managed allocation required revision of the stream library's existing handling of character arrays.
     153All reasonable stream manipulators are supported, \eg width, justification (left/right), printing characters as their numeric values, and complex input scanning to isolate strings in the input stream.
    153154
    154155
     
    159160Hence, the infamous \CC bug of iterator invalidation, where structural changes cause legitimate operations to fail, \eg iterator over a list and deleting each element.
    160161
    161 Further design provides a home for Liskov-style iterators in \CFA.
     162Further design provides a home for Liskov-style iterators (stackless-coroutine) in \CFA.
    162163This design extends a preexisting proposal to adapt the \CFA (fixed) for-each loop to be more user-pluggable, and builds upon preexisting \CFA coroutines.
    163164Overall, it simplifies the work a programmer must do to leverage the suspended-state abstraction during iteration.
Note: See TracChangeset for help on using the changeset viewer.