Changeset b195498 for doc/theses/mike_brooks_MMath/array.tex
- Timestamp:
- Apr 24, 2025, 6:35:41 PM (5 months ago)
- Branches:
- master
- Children:
- 6b33e89, f85de47
- Parents:
- f632bd50
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/array.tex
rf632bd50 rb195498 90 90 91 91 92 \section{Dependent typing}92 \section{Dependent Typing} 93 93 94 94 General dependent typing allows the type system to encode arbitrary predicates (\eg behavioural specifications for functions), … … 103 103 104 104 105 \section{Features added}105 \section{Features Added} 106 106 107 107 This section shows more about using the \CFA array and dimension parameters, demonstrating their syntax and semantics by way of motivating examples. … … 782 782 783 783 784 Figure~\ref{f:DimexprRuleCompare} gives a case-by-case comparison of the consequences of these rule sets.784 \VRef[Figure]{f:DimexprRuleCompare} gives a case-by-case comparison of the consequences of these rule sets. 785 785 It demonstrates that the \CFA false alarms occur in the same cases as C treats unsafe. 786 786 It also shows that C-incompatibilities only occur in cases that C treats unsafe. … … 859 859 860 860 861 \section{Multidimensional array implementation}861 \section{Multidimensional Array Implementation} 862 862 \label{s:ArrayMdImpl} 863 863 … … 978 978 \end{figure} 979 979 980 Figure~\ref{fig:subscr-all} shows one element (in the shaded band) accessed two different ways: as @x[2][3]@ and as @x[all][3][2]@.980 \VRef[Figure]{fig:subscr-all} shows one element (in the shaded band) accessed two different ways: as @x[2][3]@ and as @x[all][3][2]@. 981 981 In both cases, value 2 selects from the coarser dimension (rows of @x@), 982 982 while the value 3 selects from the finer dimension (columns of @x@). … … 1024 1024 % The choice to implement this style-1 system upon C's style-2 arrays, rather than its style-3 pointer arithmetic, reduces the attack surface of unsafe code. 1025 1025 % My casting is unsafe, but I do not do any pointer arithmetic. 1026 % When a programmer works in the common-case style-2 subset (in the no-@[all]@ top of Figure~\ref{fig:subscr-all}), my casts are identities, and the C compiler is doing its usual displacement calculations.1026 % When a programmer works in the common-case style-2 subset (in the no-@[all]@ top of \VRef[Figure]{fig:subscr-all}), my casts are identities, and the C compiler is doing its usual displacement calculations. 1027 1027 % If I had implemented my system upon style-3 pointer arithmetic, then this common case would be circumventing C's battle-hardened displacement calculations in favour of my own. 1028 1028 … … 1067 1067 1068 1068 1069 \section{Bound checks, added and removed}1069 \section{Bound Checks, Added and Removed} 1070 1070 1071 1071 \CFA array subscripting is protected with runtime bound checks. … … 1089 1089 1090 1090 1091 \section{Array lifecycle}1091 \section{Array Lifecycle} 1092 1092 1093 1093 An array is an aggregate, like a structure; … … 1341 1341 % note to Mike, I have more fragments on some details available in push24\fragments\uNoCtor.txt 1342 1342 1343 \section{Comparison with other arrays}1343 \section{Comparison with Other Arrays} 1344 1344 1345 1345 … … 1457 1457 1458 1458 1459 \subsection{Levels of dependently typed arrays}1459 \subsection{Levels of Dependently Typed Arrays} 1460 1460 1461 1461 The \CFA array and the field of ``array language'' comparators all leverage dependent types to improve on the expressiveness over C and Java, accommodating examples such as: … … 1504 1504 Having no instances means there is no type for a variable @i@ that constrains @i@ to be in the range for @N@, unlike Dex, [TODO: verify], but like Futhark. 1505 1505 1506 \subsection{Static safety in C extensions}1507 1508 1509 \section{Future work}1510 1511 \subsection{Declaration syntax}1512 1513 \subsection{Range slicing}1514 1515 \subsection{With a module system}1516 1517 \subsection{With described enumerations}1506 \subsection{Static Safety in C Extensions} 1507 1508 1509 \section{Future Work} 1510 1511 \subsection{Declaration Syntax} 1512 1513 \subsection{Range Slicing} 1514 1515 \subsection{With a Module System} 1516 1517 \subsection{With Described Enumerations} 1518 1518 1519 1519 A project in \CFA's current portfolio will improve enumerations. … … 1602 1602 In the case of adapting this pattern to \CFA, my current work provides an adapter from ``successively subscripted'' to ``subscripted by tuple,'' so it is likely that generalizing my adapter beyond ``subscripted by @ptrdiff_t@'' is sufficient to make a user-provided adapter unnecessary. 1603 1603 1604 \subsection{Retire pointer arithmetic}1604 \subsection{Retire Pointer Arithmetic} 1605 1605 1606 1606 … … 1614 1614 (For later: That's what I offer with array.hfa, but in the future-work vision for arrays, the fix includes helping programmers stop accidentally using a broken C-ism.) 1615 1615 1616 \subsection{\CFA features interacting with arrays}1616 \subsection{\CFA Features Interacting with Arrays} 1617 1617 1618 1618 Prior work on \CFA included making C arrays, as used in C code from the wild,
Note:
See TracChangeset
for help on using the changeset viewer.