Changeset 95448f1e


Ignore:
Timestamp:
Mar 29, 2017, 10:35:58 AM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6a86a0a, 9d944b2, b2daebd4
Parents:
3ed64ff
Message:

Added acknowledgements, spacing tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/generic_types.tex

    r3ed64ff r95448f1e  
    1 % take of review (for line numbers) and anonymous (for anonymization) on submission
    2 \documentclass[format=acmlarge, anonymous, review]{acmart}
     1% take off review (for line numbers) and anonymous (for anonymization) on submission
     2% \documentclass[format=acmlarge, anonymous, review]{acmart}
     3\documentclass[format=acmlarge, review]{acmart}
    34
    45\usepackage{listings}   % For code listings
     
    150151\begin{lstlisting}
    151152forall(otype T)
    152 T identity(T x) {
    153     return x;
    154 }
     153T identity(T x) { return x; }
    155154
    156155int forty_two = identity(42); // T is bound to int, forty_two == 42
     
    163162\begin{lstlisting}
    164163forall(otype T | { T twice(T); })
    165 T four_times(T x) {
    166     return twice( twice(x) );
    167 }
     164T four_times(T x) { return twice( twice(x) ); }
    168165
    169166double twice(double d) { return d * 2.0; } // (1)
     
    257254typedef list *list_iterator;
    258255
    259 lvalue int *?( list_iterator it ) {
    260     return it->value;
    261 }
     256lvalue int *?( list_iterator it ) { return it->value; }
    262257\end{lstlisting}
    263258
     
    410405  return ret;
    411406}
     407
    412408sum(3, 10, 20, 30);  // must keep initial counter argument in sync
    413409\end{lstlisting}
     
    679675void print(int x) { printf("%d", x);  }
    680676void print(S s) { print("{ ", s.x, ",", s.y, " }"); }
     677
    681678print("s = ", (S){ 1, 2 }, "\n");
    682679\end{lstlisting}
     
    693690  return ((T*)malloc( sizeof(T) )){ p }; // construct into result of malloc
    694691}
     692
    695693Pair(int, char) * x = new(42, '!');
    696694\end{lstlisting}
     
    794792In conclusion, the authors' design for generic types and tuples imposes minimal runtime overhead while still supporting a full range of C features, including separately-compiled modules. There is ongoing work on a wide range of \CFA{} feature extensions, including reference types, exceptions, and concurrent programming primitives. In addition to this work, there are some interesting future directions the polymorphism design could take. Notably, \CC{} template functions trade compile time and code bloat for optimal runtime of individual instantiations of polymorphic functions. \CFA{} polymorphic functions, by contrast, use an approach that is essentially dynamic virtual dispatch. The runtime overhead of this approach is low, but not as low as \CC{} template functions, and it may be beneficial to provide a mechanism for particularly performance-sensitive code to close this gap. Further research is needed, but two promising approaches are to allow an annotation on polymorphic function call sites that tells the translator to create a template-specialization of the function (provided the code is visible in the current translation unit) or placing an annotation on polymorphic function definitions that instantiates a version of the polymorphic function specialized to some set of types. These approaches are not mutually exclusive, and would allow these performance optimizations to be applied only where most useful to increase performance, without suffering the code bloat or loss of generality of a template expansion approach where it is unnecessary.
    795793
     794\begin{acks}
     795This work is supported in part by a corporate partnership with \grantsponsor{Huawei}{Huawei Ltd.}{http://www.huawei.com}\ and the first author's \grantsponsor{NSERC-PGS}{NSERC PGS D}{http://www.nserc-crsng.gc.ca/Students-Etudiants/PG-CS/BellandPostgrad-BelletSuperieures_eng.asp} scholarship.
     796\end{acks}
     797
    796798\bibliographystyle{ACM-Reference-Format}
    797799\bibliography{generic_types}
Note: See TracChangeset for help on using the changeset viewer.