Changeset 7d415b4


Ignore:
Timestamp:
Oct 9, 2024, 5:34:18 PM (6 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
0766399
Parents:
1b770e40
Message:

more proofreading of intro chapter

File:
1 edited

Legend:

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

    r1b770e40 r7d415b4  
    33All modern programming languages provide three high-level containers (collections): array, linked-list, and string.
    44Often array is part of the programming language, while linked-list is built from (recursive) pointer types, and string from a combination of array and linked-list.
    5 For all three types, languages supply varying degrees of high-level mechanism for manipulating these objects at the bulk level and at the component level, such as array copy, slicing and iterating.
     5For all three types, languages supply varying degrees of high-level mechanism for manipulating these objects at the bulk level and at the component level, such as array copy, slicing and iterating using subscripting.
    66
    77This work looks at extending these three foundational container types in the programming language \CFA, which is a new dialect of the C programming language.
    88A primary goal of \CFA~\cite{Cforall} is 99\% backward compatibility with C, while maintaining a look and feel that matches with C programmer experience and intuition.
    99This goal requires ``thinking inside the box'' to engineer new features that ``work and play'' with C and its massive legacy code-base.
    10 An additional goal is balancing good performance with safety.
     10An equally important goal is balancing good performance with safety.
    1111
    1212
     
    1414
    1515An array provides a homogeneous container with $O(1)$ access to elements using subscripting.
     16Higher-level operations like array slicing (single or multidimensional) may have significantly higher cost, but provides a better programmer experience.
    1617The array size can be static, dynamic but fixed after creation, or dynamic and variable after creation.
    1718For static and dynamic-fixed, an array can be stack allocated, while dynamic-variable requires the heap.
     
    3031\section{String}
    3132
    32 A string provides a dynamic array of homogeneous elements, where the elements are often human-readable characters.
    33 What differentiates a string from other types in that its operations work on blocks of elements for scanning and changing, \eg @index@ and @substr@.
    34 Subscripting individual elements is often available.
    35 Therefore, the cost of string operations is less important than the power of the operations to accomplish complex text manipulation, \eg search, analysing, composing, and decomposing.
     33A string provides a dynamic array of homogeneous elements, where the elements are (often) some form of human-readable characters.
     34What differentiates a string from other types in that many of its operations work on groups of elements for scanning and changing, \eg @index@ and @substr@;
     35subscripting individual elements is usually available, too.
     36Therefore, the cost of a string operation is usually less important than the power of the operation to accomplish complex text manipulation, \eg search, analysing, composing, and decomposing.
    3637The dynamic nature of a string means storage is normally heap allocated but often implicitly managed, even in unmanaged languages.
    37 Often string management is separate from heap management, \ie strings roll their own heap.
     38In some cases, string management is separate from heap management, \ie strings roll their own heap.
     39
     40
     41\section{Iterator}
     42
     43As a side issue to working with complex structured types is iterating through them.
     44Some thought has been given to \emph{general} versus specific iteration capabilities as part of of this work, but the general iteration work is only a sketch for others as future work.
     45Nevertheless, sufficed work was done to write out the ideas that developed and how they should apply in the main context of this work.
    3846
    3947
     
    4351\begin{enumerate}[leftmargin=*]
    4452\item
    45 These three aspects of C are extremely difficult to understand, teach, and get right because they are correspondingly extremely low level.
    46 Providing higher-level versions of these containers in \CFA is a major component of the primary goal.
     53These three aspects of C are difficult to understand, teach, and get right because they are correspondingly low level.
     54Providing higher-level, feature-rich versions of these containers in \CFA is a major component of the primary goal.
    4755\item
    4856These three aspects of C cause the greatest safety issues because there are few or no safe guards when a programmer misunderstands or misuses these features~\cite{Elliott18, Blache19, Ruef19, Oorschot23}.
     
    6270
    6371Like many established programming languages, C has a standards committee and multiple ANSI/\-ISO language manuals~\cite{C99,C11,C18,C23}.
    64 However, most programming languages are only partially explained by standard's manuals.
     72However, most programming languages are only partially explained by their standard's manual(s).
    6573When 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}.
    6674Often other C compilers must mimic @gcc@ because a large part of the C library (runtime) system (@glibc@ on Linux) contains @gcc@ features.
    67 While some key aspects of C need to be explained by quoting from the language reference manual, to illustrate definite program semantics, my approach in this thesis is to devise a program, whose behaviour exercises a point at issue, and shows its behaviour.
     75While some key aspects of C need to be explained and understood by quoting from the language reference manual, to illustrate actual program semantics, this thesis uses constructs a program whose behaviour exercises a particular point and then confirms the behaviour by running the program.
    6876These example programs show
    6977\begin{itemize}[leftmargin=*]
    7078        \item if the compiler accepts or rejects certain syntax,
    71         \item prints output to buttress a claim of behaviour,
     79        \item prints output to buttress a behavioural claim,
    7280        \item or executes without triggering any embedded assertions testing pre/post-assertions or invariants.
    7381\end{itemize}
    74 This work has been tested across @gcc@ versions 8--12 and clang version 10 running on ARM, AMD, and Intel architectures.
     82This work has been tested across @gcc@ versions 8--14 and clang versions 10--14 running on ARM, AMD, and Intel architectures.
    7583Any discovered anomalies among compilers or versions is discussed.
    76 In all case, it is never clear whether the \emph{truth} lies in the compiler or the C standard.
     84In all case, it is never clear whether the \emph{truth} lies in the compiler(s) or the C standard.
    7785
    7886
    7987\section{Contributions}
     88
     89This work has produced significant syntactic and semantic improvements to C's arrays, linked-lists and string types.
     90As well, a strong plan for general iteration has been sketched out.
    8091
    8192\subsection{Linked list}
Note: See TracChangeset for help on using the changeset viewer.