Ignore:
Timestamp:
May 3, 2025, 8:06:20 AM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
f466d6b
Parents:
99a7163 (diff), 57c7e6c4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/fangren_yu_MMath/intro.tex

    r99a7163 rc9c1a7e6  
    3535\end{quote}
    3636Overloading allows programmers to use the most meaningful names without fear of name clashes within a program or from external sources, like include files.
    37 Experience from \CC and \CFA developers shows the type system can implicitly and correctly disambiguates the majority of overloaded names, \ie it is rare to get an incorrect selection or ambiguity, even among hundreds of overloaded (variables and) functions.
     37Experience from \CC and \CFA developers shows the type system can implicitly and correctly disambiguate the majority of overloaded names, \ie it is rare to get an incorrect selection or ambiguity, even among hundreds of overloaded (variables and) functions.
    3838In many cases, a programmer is unaware of name clashes, as they are silently resolved, simplifying the development process.
    3939
     
    445445f( 'A' );                               $\C{// select (2)}\CRT$
    446446\end{cfa}
    447 The type system examines each call size and first looks for an exact match and then a best match using conversions.
     447The type system examines each call site and first looks for an exact match and then a best match using conversions.
    448448
    449449Ada, Scala, and \CFA type-systems also use the return type in resolving a call, to pinpoint the best overloaded name.
    450 Essentailly, the return types are \emph{reversed curried} into output parameters of the function.
     450Essentially, the return types are \emph{reversed curried} into output parameters of the function.
    451451For example, in many programming languages with overloading, the following functions are ambiguous without using the return type.
    452452\begin{cfa}
     
    643643For example, if a change is made in an initialization expression, it can cascade type changes producing many other changes and/or errors.
    644644At some point, a variable's type needs to remain constant and the initializing expression needs to be modified or be in error when it changes.
    645 Often type-inferencing systems allow restricting (\newterm{branding}) a variable or function type, so the complier can report a mismatch with the constant initialization.
     645Often type-inferencing systems allow restricting (\newterm{branding}) a variable or function type, so the compiler can report a mismatch with the constant initialization.
    646646\begin{cfa}
    647647void f( @int@ x, @int@ y ) {  // brand function prototype
     
    795795\end{tabular}
    796796\end{cquote}
    797 Traits are implemented by flatten them at use points, as if written in full by the programmer.
     797Traits are implemented by flattening them at use points, as if written in full by the programmer.
    798798Flattening often results in overlapping assertions, \eg operator @+@.
    799799Hence, trait names play no part in type equivalence.
     
    857857\end{tabular}
    858858\end{cquote}
     859\label{s:GenericImplementation}
    859860\CFA generic types are \newterm{fixed} or \newterm{dynamic} sized.
    860861Fixed-size types have a fixed memory layout regardless of type parameters, whereas dynamic types vary in memory layout depending on the type parameters.
     
    10091010\end{swift}
    10101011To make a universal function useable, an abstract description is needed for the operations used on the parameters within the function body.
    1011 Type matching these operations can occur by discover using techniques like \CC template expansion, or explicit stating, \eg interfaces, subtyping (inheritance), assertions (traits), type classes, type bounds.
     1012Type matching these operations can be done by using techniques like \CC template expansion, or explicit stating, \eg interfaces, subtyping (inheritance), assertions (traits), type classes, type bounds.
    10121013The mechanism chosen can affect separate compilation or require runtime type information (RTTI).
    10131014\begin{description}
Note: See TracChangeset for help on using the changeset viewer.