Changes in / [3d8f2f8:e84382b]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/Paper.tex

    r3d8f2f8 re84382b  
    602602[ q, r ] = div( 13.5, 5.2 );                            $\C{// assign into tuple}$
    603603\end{cfa}
    604 Clearly, this approach is straightforward to understand and use;
     604This approach is straightforward to understand and use;
    605605therefore, why do few programming languages support this obvious feature or provide it awkwardly?
    606 The answer is that there are complex consequences that cascade through multiple aspects of the language, especially the type-system.
     606To answer, there are complex consequences that cascade through multiple aspects of the language, especially the type-system.
    607607This section show these consequences and how \CFA handles them.
    608608
     
    823823where @[5, "hello"]@ is flattened, giving argument list @5, "hello"@, and @T@ binds to @int@ and @U@ binds to @const char@.
    824824Tuples, however, may contain polymorphic components.
    825 For example, a plus operator can be written to add two triples together.
     825For example, a plus operator can be written to sum two triples.
    826826\begin{cfa}
    827827forall( otype T | { T ?+?( T, T ); } ) [T, T, T] ?+?( [T, T, T] x, [T, T, T] y ) {
     
    857857As such, @ttype@ variables are also called \newterm{argument packs}.
    858858
    859 Like variadic templates, the main way to manipulate @ttype@ polymorphic functions is via recursion.
     859Like variadic templates, @ttype@ polymorphic functions are primarily manipulated via recursion.
    860860Since nothing is known about a parameter pack by default, assertion parameters are key to doing anything meaningful.
    861861Unlike variadic templates, @ttype@ polymorphic functions can be separately compiled.
    862 For example, a generalized @sum@ function written using @ttype@:
     862For example, a generalized @sum@ function:
    863863\begin{cfa}
    864864int sum$\(_0\)$() { return 0; }
     
    26582658We justify the given line count by noting that many object-oriented languages do not allow implementing new interfaces on library types without subclassing or wrapper types, which may be similarly verbose.
    26592659
    2660 Raw line-count, however, is a fairly rough measure of code complexity;
    2661 another important factor is how much type information the programmer must manually specify, especially where that information is not checked by the compiler.
     2660Line-count is a fairly rough measure of code complexity;
     2661another important factor is how much type information the programmer must specify manually, especially where that information is not compiler-checked.
    26622662Such unchecked type information produces a heavier documentation burden and increased potential for runtime bugs, and is much less common in \CFA than C, with its manually specified function pointer arguments and format codes, or \CCV, with its extensive use of untype-checked downcasts, \eg @object@ to @integer@ when popping a stack.
    26632663To quantify this manual typing, the ``redundant type annotations'' line in Table~\ref{tab:eval} counts the number of lines on which the type of a known variable is respecified, either as a format specifier, explicit downcast, type-specific function, or by name in a @sizeof@, struct literal, or @new@ expression.
     
    27762776Finally, we demonstrate that \CFA performance for some idiomatic cases is better than C and close to \CC, showing the design is practically applicable.
    27772777
    2778 There is ongoing work on a wide range of \CFA feature extensions, including arrays with size, runtime type-information, virtual functions, user-defined conversions, concurrent primitives, and modules.
    2779 (While all examples in the paper compile and run, a public beta-release of \CFA will take another 8--12 months to finalize these additional extensions.)
    2780 In addition, there are interesting future directions for the polymorphism design.
     2778There is ongoing work on a wide range of \CFA features, including arrays with size, runtime type-information, virtual functions, user-defined conversions, concurrent primitives, and modules.
     2779While all examples in the paper compile and run, a public beta-release of \CFA will take another 8--12 months to finalize these extensions.
     2780There are also interesting future directions for the polymorphism design.
    27812781Notably, \CC template functions trade compile time and code bloat for optimal runtime of individual instantiations of polymorphic functions.
    27822782\CFA polymorphic functions use dynamic virtual-dispatch;
Note: See TracChangeset for help on using the changeset viewer.