Changeset 051aec4 for doc/theses
- Timestamp:
- Mar 25, 2024, 9:02:48 AM (9 months ago)
- Branches:
- master
- Children:
- bf050c5
- Parents:
- 41fb996
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/intro.tex
r41fb996 r051aec4 1 1 \chapter{Introduction} 2 2 3 All modern programming languages provide three high-level containers (collection): array, linked , and string.4 Often array is part of the programming language, while linked is built from pointer types, and string from a combination of array and linked.3 All modern programming languages provide three high-level containers (collection): array, linked-list, and string. 4 Often array is part of the programming language, while linked-list is built from pointer types, and string from a combination of array and linked-list. 5 5 6 6 \cite{Blache19} … … 17 17 \section{Linked List} 18 18 19 Linked provides a homogeneous container with $O(log N)$/$O(N)$ access to elements using successor and predecessor operations.20 Subscripting by value is sometimes available .21 Linked types are normally dynamically sized by adding/removing node using link fields internal or external to the elements (nodes).22 If a programming language allows pointer to stack storage, linked types can be allocated on the stack;19 Linked-list provides a homogeneous container with $O(log N)$/$O(N)$ access to elements using successor and predecessor operations. 20 Subscripting by value is sometimes available, \eg hash table. 21 Linked types are normally dynamically sized by adding/removing nodes using link fields internal or external to the elements (nodes). 22 If a programming language allows pointer to stack storage, linked-list types can be allocated on the stack; 23 23 otherwise, elements are heap allocated and explicitly/implicitly managed. 24 24 … … 35 35 \section{Motivation} 36 36 37 The goal of this work is to introduce safe and complex versions of array, link , and string into the programming language \CFA, whichbased on C.38 Unfortunately, to make C better while retaining a high level of backwards compatibilityrequires a significant knowledge of C's design.37 The goal of this work is to introduce safe and complex versions of array, link-lists, and string into the programming language \CFA~\cite{CFA}, which is based on C. 38 Unfortunately, to make C better, while retaining a high level of backwards compatibility, requires a significant knowledge of C's design. 39 39 Hence, it is assumed the reader has a medium knowledge of C or \CC, on which extensive new C knowledge is built. 40 40 … … 42 42 \subsection{C?} 43 43 44 Like many established programming languages, C has a standards committee and multiple ANSI/ ISO language manuals~\cite{C99,C11,C18,C23}.45 However, most programming languages are only partially explained by thesemanuals.44 Like many established programming languages, C has a standards committee and multiple ANSI/\-ISO language manuals~\cite{C99,C11,C18,C23}. 45 However, most programming languages are only partially explained by standard's manuals. 46 46 When 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}. 47 Often other C compilers must \emph{ape} @gcc@ because a large part of the C library (runtime) system is embedded with@gcc@ features.47 Often other C compilers must \emph{ape} @gcc@ because a large part of the C library (runtime) system contains @gcc@ features. 48 48 While some key aspects of C need to be explained by quoting from the language reference manual, to illustrate definite program semantics, I devise a program, whose behaviour exercises the point at issue, and shows its behaviour. 49 49 These example programs show 50 50 \begin{itemize} 51 51 \item the compiler accepts or rejects certain syntax, 52 \item theprints output to buttress a claim of behaviour,52 \item prints output to buttress a claim of behaviour, 53 53 \item executes without triggering any embedded assertions testing pre/post-assertions or invariants. 54 54 \end{itemize} … … 77 77 with a segmentation fault at runtime. 78 78 Clearly, @gcc@ understands these ill-typed case, and yet allows the program to compile, which seems like madness. 79 Compiling with @-Werror@, which turns warnings into errors, is often too strong, because some warnings are just warnings.79 Compiling with flag @-Werror@, which turns warnings into errors, is often too strong, because some warnings are just warnings. 80 80 In the following discussion, ``ill-typed'' means giving a nonzero @gcc@ exit condition with a message that discusses typing. 81 81 Note, \CFA's type-system rejects all these ill-typed cases as type mismatch errors.
Note: See TracChangeset
for help on using the changeset viewer.