Ignore:
Timestamp:
May 13, 2025, 1:17:50 PM (10 months ago)
Author:
Mike Brooks <mlbrooks@…>
Branches:
master, stuck-waitfor-destruct
Children:
0528d79
Parents:
7d02d35 (diff), 2410424 (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/future.tex

    r7d02d35 rbd72f517  
    44The following are feature requests related to type-system enhancements that have surfaced during the development of the \CFA language and library, but have not been implemented yet.
    55Currently, developers must work around these missing features, sometimes resulting in inefficiency.
     6\PAB{The following sections discuss new features I am proposing to fix these problems.}
    67
    78
    89\section{Closed Trait Types}
    910
    10 Currently, \CFA does not have any closed types, as open type are the basis of its unique type-system, allowing new functions to be added at any time to override existing ones for trait satisfaction.
     11Currently, \CFA does not have any closed types, as open types are the basis of its unique type-system, allowing new functions to be added at any time to override existing ones for trait satisfaction.
    1112Locally-declared nested-functions,\footnote{
    1213Nested functions are not a feature in C but supported by \lstinline{gcc} for multiple decades and are used heavily in \CFA.}
     
    1718Library implementers normally do not want users to override certain operations and cause the behaviour of polymorphic invocations to change.
    1819\item
    19 Caching and reusing resolution results in the compiler is effected, as newly introduced declarations can participate in assertion resolution;
     20Caching and reusing resolution results in the compiler is affected, as newly introduced declarations can participate in assertion resolution;
    2021as a result, previously invalid subexpressions suddenly become valid, or alternatively cause ambiguity in assertions.
    2122\end{enumerate}
     
    7071\end{figure}
    7172
    72 A \CFA closed trait type is similar to a Haskell type class requiring an explicit instance declaration.
     73A \CFA closed trait type is planned to be working similarly to a Haskell type class that requires an explicit instance declaration.
    7374The syntax for the closed trait might look like:
    7475\begin{cfa}
     
    9192
    9293\section{Associated Types}
     94\label{s:AssociatedTypes}
    9395
    94 The analysis presented in \VRef{s:AssertionSatisfaction} shows if all type parameters have to be bound before assertion resolution, the complexity of resolving assertions become much lower as every assertion parameter can be resolved independently.
     96The analysis presented in \VRef{s:AssertionSatisfaction} shows if all type parameters have to be bound before assertion resolution, the complexity of resolving assertions becomes much lower as every assertion parameter can be resolved independently.
    9597That is, by utilizing information from higher up the expression tree for return value overloading, most of the type bindings can be resolved.
    9698However, there are scenarios where some intermediate types need to be involved in certain operations, which are neither input nor output types.
     
    152154Note that the type @list *@ satisfies both @pointer_like( list *, int )@ and @pointer_like( list *,@ @list )@ (the latter by the built-in pointer dereference operator) and the expression @*it@ can be either a @struct list@ or an @int@.
    153155Requiring associated types to be unique makes the @pointer_like@ trait not applicable to @list *@, which is undesirable.
    154 I have not attempted to implement associated types in \CFA compiler, but based on the above discussions, one option is to make associated type resolution and return type overloading coexist:
     156I have not attempted to implement associated types in the \CFA compiler, but based on the above discussions, one option is to make associated type resolution and return type overloading coexist:
    155157when the associated type appears in returns, it is deduced from the context and then verify the trait with ordinary assertion resolution;
    156158when it does not appear in the returns, the type is required to be uniquely determined by the expression that defines the associated type.
     
    159161\section{User-defined Conversions}
    160162
    161 Missing type-system feature is a scheme for user-defined conversions.
     163A missing type-system feature in \CFA is a scheme for user-defined conversions.
    162164Conversion means one type goes through an arbitrary complex process of changing its value to some meaningful value in another type.
    163165Because the conversion process can be arbitrarily complex, it requires the power of a function.
Note: See TracChangeset for help on using the changeset viewer.