- Timestamp:
- Apr 17, 2017, 10:12:34 PM (8 years ago)
- 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:
- 036895e, d87ade9
- Parents:
- c13b2b8
- Location:
- doc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/bibliography/cfa.bib
rc13b2b8 r2ca35b1 6221 6221 } 6222 6222 6223 @article{Smith98, 6224 keywords = {Polymorphic C}, 6225 contributor = {a3moss@uwaterloo.ca}, 6226 title={A sound polymorphic type system for a dialect of C}, 6227 author={Smith, Geoffrey and Volpano, Dennis}, 6228 journal={Science of computer programming}, 6229 volume={32}, 6230 number={1-3}, 6231 pages={49--72}, 6232 year={1998}, 6233 publisher={Elsevier} 6234 } 6235 6223 6236 @book{Campbell74, 6224 6237 keywords = {path expressions}, -
doc/generic_types/generic_types.tex
rc13b2b8 r2ca35b1 1023 1023 \section{Related Work} 1024 1024 1025 1026 \subsection{Polymorphism} 1025 % \subsection{Polymorphism} 1027 1026 1028 1027 \CC is the most similar language to \CFA; … … 1034 1033 In contrast, \CFA has a single facility for polymorphic code supporting type-safe separate-compilation of polymorphic functions and generic (opaque) types, which uniformly leverage the C procedural paradigm. 1035 1034 The key mechanism to support separate compilation is \CFA's \emph{explicit} use of assumed properties for a type. 1036 Until \CC~\cite p{C++Concepts} are standardized (anticipated for \CCtwenty), \CC provides no way to specify the requirements of a generic function in code beyond compilation errors during template expansion;1035 Until \CC~\citet{C++Concepts} are standardized (anticipated for \CCtwenty), \CC provides no way to specify the requirements of a generic function in code beyond compilation errors during template expansion; 1037 1036 furthermore, \CC concepts are restricted to template polymorphism. 1038 1037 … … 1042 1041 In \CFA terms, all Cyclone polymorphism must be dtype-static. 1043 1042 While the Cyclone design provides the efficiency benefits discussed in Section~\ref{sec:generic-apps} for dtype-static polymorphism, it is more restrictive than \CFA's general model. 1043 \citet{Smith98} present Polymorphic C, an ML dialect with polymorphic functions and C-like syntax and pointer types; it lacks many of C's features, however, most notably struct types, and so is not a practical C replacement. 1044 1044 1045 1045 \citet{obj-c-book} is an industrially successful extension to C. 1046 1046 However, Objective-C is a radical departure from C, using an object-oriented model with message-passing. 1047 Objective-C did not support type-checked generics until recently ~\citet{xcode7}, historically using less-efficient and more error-proneruntime checking of object types.1047 Objective-C did not support type-checked generics until recently \citep{xcode7}, historically using less-efficient runtime checking of object types. 1048 1048 The~\citet{GObject} framework also adds object-oriented programming with runtime type-checking and reference-counting garbage-collection to C; 1049 1049 these features are more intrusive additions than those provided by \CFA, in addition to the runtime overhead of reference-counting. 1050 \citet{Vala} compiles to GObject-based C, and so adds the burden of learning a separate language syntax to the aforementioned demerits of GObject as a modernization path for the existing C code-bases. 1051 Java~\citep{Java8} included generic types in Java~5; 1052 Java's generic types are type-checked at compilation and type-erased at runtime, similar to \CFA's. 1050 \citet{Vala} compiles to GObject-based C, adding the burden of learning a separate language syntax to the aforementioned demerits of GObject as a modernization path for existing C code-bases. 1051 Java~\citep{Java8} included generic types in Java~5 which are type-checked at compilation and type-erased at runtime, similar to \CFA's. 1053 1052 However, in Java, each object carries its own table of method pointers, while \CFA passes the method pointers separately to maintain a C-compatible layout. 1054 1053 Java is also a garbage-collected, object-oriented language, with the associated resource usage and C-interoperability burdens. … … 1064 1063 \CFA, with its more modest safety features, allows direct ports of C code while maintaining the idiomatic style of the original source. 1065 1064 1066 1067 \subsection{Tuples/Variadics} 1065 % \subsection{Tuples/Variadics} 1068 1066 1069 1067 Many programming languages have some form of tuple construct and/or variadic functions, \eg SETL, C, KW-C, \CC, D, Go, Java, ML, and Scala. … … 1098 1096 1099 1097 There is ongoing work on a wide range of \CFA feature extensions, including reference types, exceptions, concurrent primitives and modules. 1100 (While all examples in the paper compile and run, a public beta-release of \CFA will take another 8--12 months to finalize these addition extensions.)1098 (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.) 1101 1099 In addition, there are interesting future directions for the polymorphism design. 1102 1100 Notably, \CC template functions trade compile time and code bloat for optimal runtime of individual instantiations of polymorphic functions. 1103 \CFA polymorphic functions use s a dynamic virtual-dispatch.1104 The runtime overhead of this approach is low, but not as low as inlining, and it may be beneficial to provide a mechanism for performance-sensitive code.1101 \CFA polymorphic functions use dynamic virtual-dispatch; 1102 the runtime overhead of this approach is low, but not as low as inlining, and it may be beneficial to provide a mechanism for performance-sensitive code. 1105 1103 Two promising approaches are an @inline@ annotation at polymorphic function call sites to create a template-specialization of the function (provided the code is visible) or placing an @inline@ annotation on polymorphic function-definitions to instantiate a specialized version for some set of types. 1106 1104 These approaches are not mutually exclusive and allow performance optimizations to be applied only when necessary, without suffering global code-bloat.
Note: See TracChangeset
for help on using the changeset viewer.