source: doc/theses/mike_brooks_MMath/conclusion.tex@ eeefc0c

Last change on this file since eeefc0c was 402f249, checked in by Peter A. Buhr <pabuhr@…>, 5 weeks ago

add one more item to future work in conclusion

  • Property mode set to 100644
File size: 4.7 KB
Line 
1\chapter{Conclusion}
2
3This thesis performed a detailed examination of the three most important high-level containers in many programming languages: array, linked-list, and string.
4The goal of the work is to make containers easier to use, performant and safer.
5Since some subset of these three containers are used in almost every program in every programming language, this is a laudable goal.
6Accomplishing this goal in C is difficult because these features are poorly designed.
7In contrast, \CFA's advanced type system and language features plus my critical design choices made it possible to provide better support with significant safety.
8The result is application code that is easier to write, understand, maintain, and significantly safer from hacker attach-vectors.
9Finally, the performance sections for each container demonstrated that safety does not have to reduce performance, \ie rolling-your-own container is now an excuse not a reason.
10
11
12\section{Arrays}
13
14The key takeaway for arrays is that the type system must be extended to properly manage array bounds (dimensions) to safely pass arrays to (polymorphic) functions.
15By adding a special kind of template constant to \CFA, @[N]@, the type system understands array bounds and implicitly associates these bounds with array instances, statically and dynamically, throughout the programming language.
16Array overruns are no longer possible because all subscripting is checked, as in other modern languages.
17Subscript checking can be implicitly elided when the compiler is given sufficient information to determine the subscript variable is always in bounds, giving performant execution.
18Indirectly, simple and complex VLA's reduce heap allocation resulting in better performance (up to an order of magnitude in comparisons with @std::vector@) and no contention in concurrent programs.
19Any reduction of dynamic allocation is always a safety benefit.
20Finally, language subarray slicing of higher-dimensional arrays is also a powerful and safety critical feature versus programmers attempting it themselves.
21
22
23\section{Lists}
24
25The key takeaway for lists is that intrusive lists can be made easy to use, performant by eliminating implicit memory allocation, and able to simulate wrapped lists, whereas wrapped lists cannot simulate intrusive lists.
26As well, the \CFA list-API eliminates many frustrating and error-prone requirements with \CC STL lists, \eg, a node can be returned and removed in a single operation (no 2-step @front@/@pop@), and an arbitrary node can be added/removed without the need for an iterator.
27As for \CC, the \CFA list API is powerful enough to reduce almost all common C list errors, substantially increasing program safety.
28
29
30\section{Strings}
31
32The key takeaway for strings is that providing powerful and safe block-operations for manipulating strings is more important than ultra-level performance.
33Manipulating strings is always going to be expensive because of their dynamic variable sizing, as the hardware rarely has string-level operations, possibly only move and compare.
34The new \CFA string API is a very expressive set of safe string operations for composing, comparing, and decomposing arbitrary length strings, include complex reading and printing operations.
35All low-level mechanisms for working with string, in any programming language, are error-prone in correctness and safety (back to working with arrays).
36Providing string lengths is also a significant safety improvement, while still working with compiler null-terminate string constants (as for \CC).
37As well, overloading C string operations to work with \CFA strings provides a safe vector for updating existing C programs manipulating strings.
38Finally, creating bespoke storage management for strings has the advantage of faster, more compact storage management due to string sharing, at the cost of additional external fragmentation between the string and general heap.
39With the large amounts of available memory, this approach is a viable tradeoff.
40
41
42\section{Future Work}
43
44All three forms of containers presented in this work are in their nascence, both in design and implementation.
45This work provides the foundation for future \CFA students to add more functionality along with robust and performant implementations.
46Completing the syntax change from @array@ to C-style for dimensions and subscripts is an important first step to fit with C-programmer expectation resulting in faster adoption.
47Also, adding a panoply of additional intrusive lists, \eg stack, queue, dequeue, \etc, is needed to complement the @list@ structure.
48And once the RAII problem in \CFA is fixed, the two part string implementation can be merged into a single form, possibly with even better performance.
49I left all the infrastructure to accomplish these task;
50they just need time to complete.
Note: See TracBrowser for help on using the repository browser.