Index: doc/bibliography/cfa.bib
===================================================================
--- doc/bibliography/cfa.bib	(revision 31959537c1e9de2d281867b5d9c2a2027f164290)
+++ doc/bibliography/cfa.bib	(revision 4fc45ff2c77dee81fe985eb3414cbd30cf4778e7)
@@ -6549,4 +6549,12 @@
 }
 
+@unpublished{TIOBE,
+    contributer	= {pabuhr@plg},
+    author	= {TIOBE Index},
+    title	= {},
+    year	= {March 2017},
+    note	= {\url{http://www.tiobe.com/tiobe_index}},
+}
+
 @misc{Bumbulis90,
     keywords	= {parameter inference, ForceN},
@@ -6555,5 +6563,6 @@
     title	= {Towards Making Signatures First-Class},
     howpublished= {personal communication},
-    month	= sep, year = 1990,
+    month	= sep,
+    year	= 1990,
     note	= {}
 }
Index: doc/generic_types/generic_types.tex
===================================================================
--- doc/generic_types/generic_types.tex	(revision 31959537c1e9de2d281867b5d9c2a2027f164290)
+++ doc/generic_types/generic_types.tex	(revision 4fc45ff2c77dee81fe985eb3414cbd30cf4778e7)
@@ -28,4 +28,6 @@
 \newcommand{\CCseventeen}{\rm C\kern-.1em\hbox{+\kern-.25em+}17\xspace} % C++17 symbolic name
 \newcommand{\CCtwenty}{\rm C\kern-.1em\hbox{+\kern-.25em+}20\xspace} % C++20 symbolic name
+\newcommand{\CS}{C\raisebox{-0.7ex}{\Large$^\sharp$}\xspace}
+\newcommand{\Textbf}[1]{{\color{red}\textbf{#1}}}
 
 \newcommand{\TODO}[1]{\textbf{TODO}: {\itshape #1}} % TODO included
@@ -124,36 +126,55 @@
 \maketitle
 
-\section{Introduction \& Background}
-
-\CFA\footnote{Pronounced ``C-for-all'', and written \CFA or Cforall.} is an evolutionary extension of the C programming language that aims to add modern language features to C while maintaining both source compatibility with C and a familiar programming model for programmers. Four key design goals were set out in the original design of \CFA~\citep{Bilson03}:
-\begin{enumerate}
-\item The behaviour of standard C code must remain the same when translated by a \CFA compiler as when translated by a C compiler.
-\item Standard C code must be as fast and as small when translated by a \CFA compiler as when translated by a C compiler.
-\item \CFA code must be at least as portable as standard C code.
-\item Extensions introduced by \CFA must be translated in the most efficient way possible.
-\end{enumerate}
+
+\section{Introduction and Background}
+
+The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from commercial operating-systems to hobby projects. This installation base and the programmers producing it represent a massive software-engineering investment spanning decades and likely to continue for decades more.
+TIOBE~\cite{TIOBE} ranks the top 5 most popular programming languages as: Java 16\%, \Textbf{C 7\%}, \Textbf{\CC 5\%}, \CS 4\%, Python 4\% = 36\%, where the next 50 languages are less than 3\% each with a long tail. The top 3 rankings over the past 30 years are:
+\lstDeleteShortInline@
+\begin{center}
+\setlength{\tabcolsep}{10pt}
+\begin{tabular}{@{}r|c|c|c|c|c|c|c@{}}
+		& 2017	& 2012	& 2007	& 2002	& 1997	& 1992	& 1987		\\
+\hline
+Java	& 1		& 1		& 1		& 3		& 13	& -		& -			\\
+\hline
+\Textbf{C}	& \Textbf{2}& \Textbf{2}& \Textbf{2}& \Textbf{1}& \Textbf{1}& \Textbf{1}& \Textbf{1}	\\
+\hline
+\CC		& 3		& 3		& 3		& 3		& 2		& 2		& 4			\\
+\end{tabular}
+\end{center}
+\lstMakeShortInline@
+Love it or hate it, C is extremely popular, highly used, and one of the few system's languages.
+In many cases, \CC is often used solely as a better C.
+Nonetheless, C, first standardized over thirty years ago, lacks many features that make programming in more modern languages safer and more productive.
+
+\CFA (pronounced ``C-for-all'', and written \CFA or Cforall) is an evolutionary extension of the C programming language that aims to add modern language features to C while maintaining both source compatibility with C and a familiar programming model for programmers. Four key design goals were set out in the original design of \CFA~\citep{Bilson03}:
+(1) The behaviour of standard C code must remain the same when translated by a \CFA compiler as when translated by a C compiler;
+(2) Standard C code must be as fast and as small when translated by a \CFA compiler as when translated by a C compiler;
+(3) \CFA code must be at least as portable as standard C code;
+(4) Extensions introduced by \CFA must be translated in the most efficient way possible.
 These goals ensure existing C code-bases can be converted to \CFA incrementally and with minimal effort, and C programmers can productively generate \CFA code without training beyond the features they wish to employ. In its current implementation, \CFA is compiled by translating it to the GCC-dialect of C~\citep{GCCExtensions}, allowing it to leverage the portability and code optimizations provided by GCC, meeting goals (1)-(3). Ultimately, a compiler is necessary for advanced features and optimal performance.
 
-\CFA has been previously extended with polymorphic functions and name overloading (including operator overloading) by \citet{Bilson03}, and deterministically-executed constructors and destructors by \citet{Schluntz17}. This paper builds on those contributions, identifying shortcomings in existing approaches to generic and variadic data types in C-like languages and presenting a design of generic and variadic types as as extension of the \CFA language that avoids those shortcomings. Particularly, the solution we present is both reusable and type-checked, as well as conforming to the design goals of \CFA and ergonomically using existing C abstractions. We have empirically compared our new design to both standard C and \CC; the results show that this design is \TODO{awesome, I hope}.
+\CFA has been previously extended with polymorphic functions and name overloading (including operator overloading) by \citet{Bilson03}, and deterministically-executed constructors and destructors by \citet{Schluntz17}. This paper builds on those contributions, identifying shortcomings in existing approaches to generic and variadic data types in C-like languages and presenting a design for generic and variadic types avoiding those shortcomings. Specifically, the solution is both reusable and type-checked, as well as conforming to the design goals of \CFA with ergonomic use of existing C abstractions. The new constructs are empirically compared with both standard C and \CC; the results show the new design is comparable in performance.
+
 
 \subsection{Polymorphic Functions}
 \label{sec:poly-fns}
 
-\CFA's polymorphism was originally formalized by \citet{Ditchfield92}, and first implemented by \citet{Bilson03}. The signature feature of \CFA is parametric-polymorphic functions; such functions are written using a @forall@ clause (which gives the language its name):
+\CFA's polymorphism was originally formalized by \citet{Ditchfield92}, and first implemented by \citet{Bilson03}. The signature feature of \CFA is parametric-polymorphic functions where functions are generalized using a @forall@ clause (giving the language its name):
 \begin{lstlisting}
 `forall( otype T )` T identity( T val ) { return val; }
 int forty_two = identity( 42 );				$\C{// T is bound to int, forty\_two == 42}$
 \end{lstlisting}
-The @identity@ function above can be applied to any complete object-type (or ``@otype@''). The type variable @T@ is transformed into a set of additional implicit parameters to @identity@ that encode sufficient information about @T@ to create and return a variable of that type. The \CFA implementation passes the size and alignment of the type represented by an @otype@ parameter, as well as an assignment operator, constructor, copy constructor and destructor. If this extra information is not needed, \eg for a pointer, the type parameter can be declared as @dtype T@, where @dtype@ is short for ``data type''.
-
-Here, the runtime cost of polymorphism is spread over each polymorphic call, due to passing more arguments to polymorphic functions; preliminary experiments have shown this overhead to be similar to \CC virtual function calls. An advantage of this design is that, unlike \CC template functions, \CFA @forall@ functions are compatible with C separate compilation.
-
-Since bare polymorphic-types provide only a narrow set of available operations, \CFA provides a \emph{type assertion} mechanism to provide further type information, where type assertions may be variable or function declarations that depend on a polymorphic type variable. For instance, @twice@ can be defined using the \CFA syntax for operator overloading:
-\begin{lstlisting}
-forall( otype T | { T `?`+`?`(T, T); } )	$\C{// ? denotes operands}$
-  T twice( T x ) { return x + x; }			$\C{// (2)}$
+The @identity@ function above can be applied to any complete object-type (or ``@otype@''). The type variable @T@ is transformed into a set of additional implicit parameters encoding sufficient information about @T@ to create and return a variable of that type. The \CFA implementation passes the size and alignment of the type represented by an @otype@ parameter, as well as an assignment operator, constructor, copy constructor and destructor. If this extra information is not needed, \eg for a pointer, the type parameter can be declared as @dtype T@, where @dtype@ is short for ``data type''.
+
+Here, the runtime cost of polymorphism is spread over each polymorphic call, due to passing more arguments to polymorphic functions; preliminary experiments have shown this overhead is similar to \CC virtual function calls. An advantage of this design is that, unlike \CC template functions, \CFA @forall@ functions are compatible with C \emph{separate} compilation.
+
+Since bare polymorphic-types provide only a narrow set of available operations, \CFA provides a \emph{type assertion} mechanism to provide further type information, where type assertions may be variable or function declarations that depend on a polymorphic type-variable. For example, the function @twice@ can be defined using the \CFA syntax for operator overloading:
+\begin{lstlisting}
+forall( otype T `| { T ?+?(T, T); }` ) T twice( T x ) { return x + x; }	$\C{// ? denotes operands}$
 int val = twice( twice( 3.7 ) );
 \end{lstlisting}
-which works for any type @T@ with an addition operator defined. The translator accomplishes this polymorphism by creating a wrapper function for calling @+@ with @T@ bound to @double@, then providing this function to the first call of @twice@. It then has the option of using the same @twice@ again and converting the result to @int@ on assignment, or creating another @twice@ with type parameter @T@ bound to @int@ because \CFA uses the return type in its type analysis. The first approach has a late conversion from integer to floating-point on the final assignment, while the second has an eager conversion to integer. \CFA minimizes the number of conversions and their potential to lose information, so it selects the first approach.
+which works for any type @T@ with a matching addition operator. The polymorphism is achieved by creating a wrapper function for calling @+@ with @T@ bound to @double@, then passing this function to the first call of @twice@. There is now the option of using the same @twice@ and converting the result to @int@ on assignment, or creating another @twice@ with type parameter @T@ bound to @int@ because \CFA uses the return type in its type analysis. The first approach has a late conversion from @int@ to @double@ on the final assignment, while the second has an eager conversion to @int@. \CFA minimizes the number of conversions and their potential to lose information, so it selects the first approach, which corresponds with C-programmer intuition.
 
 Monomorphic specializations of polymorphic functions can satisfy polymorphic type-assertions.
@@ -165,14 +186,11 @@
 % \end{lstlisting}
 \begin{lstlisting}
-forall( otype T `| { int ?<?( T, T ); }` )	$\C{// type assertion}$
-  void qsort( const T * arr, size_t size );
-forall( otype T `| { int ?<?( T, T ); }` )	$\C{// type assertion}$
-  T * bsearch( T key, const T * arr, size_t size );
+forall( otype T `| { int ?<?( T, T ); }` ) void qsort( const T * arr, size_t size );
+forall( otype T `| { int ?<?( T, T ); }` ) T * bsearch( T key, const T * arr, size_t size );
 double vals[10] = { /* 10 floating-point values */ };
 qsort( vals, 10 );							$\C{// sort array}$
 double * val = bsearch( 5.0, vals, 10 );	$\C{// binary search sorted array for key}$
 \end{lstlisting}
-@qsort@ and @bsearch@ can only be called with arguments for which there exists a function named @<@ taking two arguments of the same type and returning an @int@ value.
-Here, the built-in monomorphic specialization of @<@ for type @double@ is passed as an additional implicit parameter to the calls of @qsort@ and @bsearch@.
+@qsort@ and @bsearch@ work for any type @T@ with a matching @<@ operator, and the built-in monomorphic specialization of @<@ for type @double@ is passed as an implicit parameter to the calls of @qsort@ and @bsearch@.
 
 Crucial to the design of a new programming language are the libraries to access thousands of external features.
@@ -187,5 +205,5 @@
 double * val = (double *)bsearch( &key, vals, size, sizeof(vals[0]), comp );
 \end{lstlisting}
-but providing a type-safe \CFA overloaded wrapper.
+which can be augmented simply with a generalized, type-safe, \CFA-overloaded wrapper:
 \begin{lstlisting}
 forall( otype T | { int ?<?( T, T ); } ) T * bsearch( T key, const T * arr, size_t size ) {
@@ -201,5 +219,5 @@
 \end{lstlisting}
 The nested routine @comp@ provides the hidden interface from typed \CFA to untyped (@void *@) C, plus the cast of the result.
-As well, an alternate kind of return is made available, position versus pointer to found element.
+As well, an alternate kind of return is made available: position versus pointer to found element.
 \CC's type-system cannot disambiguate between the two versions of @bsearch@ because it does not use the return type in overload resolution, nor can \CC separately compile a templated @bsearch@.
 
@@ -211,5 +229,5 @@
 \end{lstlisting}
 Within the block, the nested version of @<@ performs @>@ and this local version overrides the built-in @<@ so it is passed to @qsort@.
-Hence, programmers can easily form new local environments to maximize reuse of existing functions and types.
+Hence, programmers can easily form a local environments, adding and modifying appropriate functions, to maximize reuse of other existing functions and types.
 
 Finally, \CFA allows variable overloading:
@@ -233,23 +251,8 @@
 Hence, the single name @MAX@ replaces all the C type-specific names: @SHRT_MAX@, @INT_MAX@, @DBL_MAX@.
 
+
 \subsection{Traits}
 
-\CFA provides \emph{traits} to name a group of type assertions:
-% \begin{lstlisting}
-% trait has_magnitude(otype T) {
-%     _Bool ?<?(T, T);						$\C{// comparison operator for T}$
-%     T -?(T);								$\C{// negation operator for T}$
-%     void ?{}(T*, zero_t);					$\C{// constructor from 0 literal}$
-% };
-% forall(otype M | has_magnitude(M))
-% M abs( M m ) {
-%     M zero = { 0 };							$\C{// uses zero\_t constructor from trait}$
-%     return m < zero ? -m : m;
-% }
-% forall(otype M | has_magnitude(M))
-% M max_magnitude( M a, M b ) {
-%     return abs(a) < abs(b) ? b : a;
-% }
-% \end{lstlisting}
+\CFA provides \emph{traits} to name a group of type assertions, where the trait name allows specifying the same set of assertions in multiple locations, preventing repetition mistakes at each function declaration:
 \begin{lstlisting}
 trait summable( otype T ) {
@@ -262,5 +265,5 @@
 forall( otype T | summable( T ) )
   T sum( T a[$\,$], size_t size ) {
-	`T` total = { `0` };					$\C{// instantiate T from 0}$
+	`T` total = { `0` };					$\C{// instantiate T from 0 but calling its constructor}$
 	for ( unsigned int i = 0; i < size; i += 1 )
 		total `+=` a[i];					$\C{// select appropriate +}$
@@ -268,10 +271,8 @@
 }
 \end{lstlisting}
-The trait name allows specifying the same set of assertions in multiple locations, preventing repetition mistakes at each function declaration.
 
 In fact, the set of operators is incomplete, \eg no assignment, but @otype@ is syntactic sugar for the following implicit trait:
 \begin{lstlisting}
-trait otype( dtype T | sized(T) ) {
-	// sized is a compiler-provided pseudo-trait for types with known size and alignment}
+trait otype( dtype T | sized(T) ) {  // sized is a pseudo-trait for types with known size and alignment
 	void ?{}( T * );						$\C{// default constructor}$
 	void ?{}( T *, T );						$\C{// copy constructor}$
@@ -280,45 +281,45 @@
 };
 \end{lstlisting}
-Given the information provided for an @otype@, variables of polymorphic type can be treated as if they were a complete struct type -- they can be stack-allocated using the @alloca@ compiler builtin, default or copy-initialized, assigned, and deleted. As an example, the @sum@ function produces generated code something like the following (simplified for clarity and brevity)\TODO{fix example, maybe elide, it's likely too long with the more complicated function}:
-\begin{lstlisting}
-void abs( size_t _sizeof_M, size_t _alignof_M,
-		void (*_ctor_M)(void*), void (*_copy_M)(void*, void*),
-		void (*_assign_M)(void*, void*), void (*_dtor_M)(void*),
-		_Bool (*_lt_M)(void*, void*), void (*_neg_M)(void*, void*),
-    	void (*_ctor_M_zero)(void*, int),
-		void* m, void* _rtn ) {				$\C{// polymorphic parameter and return passed as void*}$
-											$\C{// M zero = { 0 };}$
-	void* zero = alloca(_sizeof_M);			$\C{// stack allocate zero temporary}$
-	_ctor_M_zero(zero, 0);					$\C{// initialize using zero\_t constructor}$
-											$\C{// return m < zero ? -m : m;}$
-	void *_tmp = alloca(_sizeof_M);
-	_copy_M( _rtn,							$\C{// copy-initialize return value}$
-		_lt_M( m, zero ) ?					$\C{// check condition}$
-		 (_neg_M(m, _tmp), _tmp) :			$\C{// negate m}$
-		 m);
-	_dtor_M(_tmp); _dtor_M(zero);			$\C{// destroy temporaries}$
-}
-\end{lstlisting}
-
-Traits may be used for many of the same purposes as interfaces in Java or abstract base classes in \CC. Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy, which is a form of structural inheritance, similar to the implementation of an interface in Go~\citep{Go}, as opposed to the nominal inheritance model of Java and \CC. Nominal inheritance can be simulated with traits using marker variables or functions:
+Given the information provided for an @otype@, variables of polymorphic type can be treated as if they were a complete type: stack-allocatable, default or copy-initialized, assigned, and deleted.
+% As an example, the @sum@ function produces generated code something like the following (simplified for clarity and brevity)\TODO{fix example, maybe elide, it's likely too long with the more complicated function}:
+% \begin{lstlisting}
+% void abs( size_t _sizeof_M, size_t _alignof_M,
+% 		void (*_ctor_M)(void*), void (*_copy_M)(void*, void*),
+% 		void (*_assign_M)(void*, void*), void (*_dtor_M)(void*),
+% 		_Bool (*_lt_M)(void*, void*), void (*_neg_M)(void*, void*),
+%     	void (*_ctor_M_zero)(void*, int),
+% 		void* m, void* _rtn ) {				$\C{// polymorphic parameter and return passed as void*}$
+% 											$\C{// M zero = { 0 };}$
+% 	void* zero = alloca(_sizeof_M);			$\C{// stack allocate zero temporary}$
+% 	_ctor_M_zero(zero, 0);					$\C{// initialize using zero\_t constructor}$
+% 											$\C{// return m < zero ? -m : m;}$
+% 	void *_tmp = alloca(_sizeof_M);
+% 	_copy_M( _rtn,							$\C{// copy-initialize return value}$
+% 		_lt_M( m, zero ) ?					$\C{// check condition}$
+% 		 (_neg_M(m, _tmp), _tmp) :			$\C{// negate m}$
+% 		 m);
+% 	_dtor_M(_tmp); _dtor_M(zero);			$\C{// destroy temporaries}$
+% }
+% \end{lstlisting}
+
+Traits may be used for many of the same purposes as interfaces in Java or abstract base classes in \CC. Unlike Java interfaces or \CC base classes, \CFA types do not explicitly state any inheritance relationship to traits they satisfy, which is a form of structural inheritance, similar to the implementation of an interface in Go~\citep{Go}, as opposed to the nominal inheritance model of Java and \CC.
+
+Nominal inheritance can be simulated with traits using marker variables or functions:
 \begin{lstlisting}
 trait nominal(otype T) {
     T is_nominal;
 };
-
 int is_nominal;								$\C{// int now satisfies the nominal trait}$
 \end{lstlisting}
 
-Traits, however, are significantly more powerful than nominal-inheritance interfaces; most notably, traits may be used to declare a relationship among multiple types, a property that may be difficult or impossible to represent in nominal-inheritance type systems:
+Traits, however, are significantly more powerful than nominal-inheritance interfaces; most notably, traits may be used to declare a relationship \emph{among} multiple types, a property that may be difficult or impossible to represent in nominal-inheritance type systems:
 \begin{lstlisting}
 trait pointer_like(otype Ptr, otype El) {
     lvalue El *?(Ptr);						$\C{// Ptr can be dereferenced into a modifiable value of type El}$
 }
-
 struct list {
     int value;
     list *next;								$\C{// may omit "struct" on type names as in \CC}$
 };
-
 typedef list *list_iterator;
 
