Changeset 02ea981


Ignore:
Timestamp:
Oct 16, 2024, 1:31:40 PM (5 weeks ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
187be97, e8b5ba4
Parents:
4e0168a
Message:

Thesis introduction contributions, first try.

File:
1 edited

Legend:

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

    r4e0168a r02ea981  
    1919Because array layout has contiguous components, subscripting is a computation (some form of pointer arithmetic).
    2020
     21C provides an array as a language feature.
    2122
    2223\section{Linked list}
    2324
    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.
     25A 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.
    2526Subscripting by value is sometimes available, \eg hash table.
    2627Linked types are normally dynamically sized by adding/removing nodes using link fields internal or external to the elements (nodes).
     
    2829otherwise, elements are heap allocated with explicitly/implicitly managed.
    2930
     31C does not provide a linked-list, either as an obvious commonly-accepted library, nor as an outright language feature.
     32C programmers commonly build linked-list behaviours into their bespoke data structures, directly using its language feature of pointers.
    3033
    3134\section{String}
     
    3841In some cases, string management is separate from heap management, \ie strings roll their own heap.
    3942
     43The C string type is a user-managed allocation of the language-provided character array,
     44plus the convention of marking its (variable) length by placing the 0-valued control character at the end (``null-terminated'').
     45The C standard library includes many operations for working on this representation.
    4046
    4147\section{Iterator}
     
    9096As well, a strong plan for general iteration has been sketched out.
    9197
     98This thesis mainly describes improvements made to the source code of the \CFA compiler and runtime system,
     99available at TODO.
     100
     101This work often leverages preexisting    xxxxxxxxxx
     102
    92103\subsection{Linked list}
     104
     105The linked list is a new runtime library, available as @#include <dlist.hfa>@.
     106The library offers a novel combination of the preexisting \CFA features of:
     107references, inline inheritance, polymorphism and declaration scoping.
     108A programmer's experience of the list datatype within the type system is novel.
     109The list's runtime representation follows the established design pattern of intrusion.
     110This thesis includes a performance evaluation that shows
     111the list performing comparably with other C-family intrusive lists,
     112and notably better than the \CC standard list.
    93113
    94114\subsection{Array}
    95115
     116This work's array improvements are
     117\begin{enumerate}[leftmargin=*]
     118\item
     119subtle changes to the typing rules for the C array,
     120\item
     121a new \CFA language construct for a type-system managed array length, and
     122\item
     123a new standard-library array type, available as @#include <array.hfa>@.
     124\end{enumerate}
     125The new array type, enabled by the earlier features, defines an array with
     126guaranteed runtime bound checks (often optimizer-removable) and
     127implicit (guaranteed accurate) inter-function length communication.
     128Leveraging the preexisting \CFA type system to achieve
     129this length-related type checking is an original contribution.
     130
     131Furthermore, the new array incorporates multidimensional capabilities
     132typical of scientific/machine-learning languages,
     133made to coexist with the C ``raw-memory-aware'' tradition in a novel way.
     134
    96135\subsection{String}
    97136
     137The string is a new runtime library, available as @#include <string.hfa>@.
     138The library offers a type whose basic usage is comparable to the \CC @string@ type,
     139including analogous coexistence with raw character pointers.
     140Its implementation, however, follows different princliples,
     141enabling programs to work with strings by value, without incurring excessive copying.
     142Mutability is retained.
     143Substrings are supported, including the ability for overlapping ranges to share edits transparently.
     144Ultimately, this implementation is a case of strings rolling their own heap.
     145
     146The string library includes writing and reading strings via the preexsiting \CFA I/O stream library.
     147Enabling transparent reading (of unknown length into a managed allocation) included revision of
     148the stream libarary's existing handling of character arrays.
     149
    98150\subsection{Iterator}
     151
     152Some prototyping, available in the \CFA standard library,
     153addresses the infamous \CC bug source of iterator invalidation.
     154A family of iterator styles is presented, with cheap iterators that resist being misused,
     155plus full-featured iterators that observe modifications without becoming invalid.
     156
     157Further design within this thesis presents a home for Liskov-style iterators in \CFA.
     158This design extends a preexisting proposal to adapt the \CFA for-each style loop to be more user-pluggable.
     159It also builds upon preexisting \CFA coroutines.
     160It simplifies the work a programmer must do to leverage the suspended-state abstraction.
Note: See TracChangeset for help on using the changeset viewer.