Changeset bd72f517 for doc/theses/fangren_yu_MMath/future.tex
- Timestamp:
- May 13, 2025, 1:17:50 PM (10 months ago)
- 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. - File:
-
- 1 edited
-
doc/theses/fangren_yu_MMath/future.tex (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/fangren_yu_MMath/future.tex
r7d02d35 rbd72f517 4 4 The 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. 5 5 Currently, 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.} 6 7 7 8 8 9 \section{Closed Trait Types} 9 10 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.11 Currently, \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. 11 12 Locally-declared nested-functions,\footnote{ 12 13 Nested functions are not a feature in C but supported by \lstinline{gcc} for multiple decades and are used heavily in \CFA.} … … 17 18 Library implementers normally do not want users to override certain operations and cause the behaviour of polymorphic invocations to change. 18 19 \item 19 Caching and reusing resolution results in the compiler is effected, as newly introduced declarations can participate in assertion resolution;20 Caching and reusing resolution results in the compiler is affected, as newly introduced declarations can participate in assertion resolution; 20 21 as a result, previously invalid subexpressions suddenly become valid, or alternatively cause ambiguity in assertions. 21 22 \end{enumerate} … … 70 71 \end{figure} 71 72 72 A \CFA closed trait type is similar to a Haskell type class requiringan explicit instance declaration.73 A \CFA closed trait type is planned to be working similarly to a Haskell type class that requires an explicit instance declaration. 73 74 The syntax for the closed trait might look like: 74 75 \begin{cfa} … … 91 92 92 93 \section{Associated Types} 94 \label{s:AssociatedTypes} 93 95 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.96 The 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. 95 97 That is, by utilizing information from higher up the expression tree for return value overloading, most of the type bindings can be resolved. 96 98 However, there are scenarios where some intermediate types need to be involved in certain operations, which are neither input nor output types. … … 152 154 Note 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@. 153 155 Requiring 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:156 I 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: 155 157 when the associated type appears in returns, it is deduced from the context and then verify the trait with ordinary assertion resolution; 156 158 when it does not appear in the returns, the type is required to be uniquely determined by the expression that defines the associated type. … … 159 161 \section{User-defined Conversions} 160 162 161 Missing type-system featureis a scheme for user-defined conversions.163 A missing type-system feature in \CFA is a scheme for user-defined conversions. 162 164 Conversion means one type goes through an arbitrary complex process of changing its value to some meaningful value in another type. 163 165 Because the conversion process can be arbitrarily complex, it requires the power of a function.
Note:
See TracChangeset
for help on using the changeset viewer.