Changeset edd11bd for doc/theses/fangren_yu_MMath/features.tex
- Timestamp:
- May 12, 2025, 8:59:26 PM (10 months ago)
- Branches:
- master, stuck-waitfor-destruct
- Children:
- 2410424
- Parents:
- 8fe7a85
- File:
-
- 1 edited
-
doc/theses/fangren_yu_MMath/features.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/fangren_yu_MMath/features.tex
r8fe7a85 redd11bd 122 122 \end{cfa} 123 123 the call to @foo@ must pass @x@ by value, implying auto-dereference, while the call to @bar@ must pass @x@ by reference, implying no auto-dereference. 124 Without any restrictions, this ambiguity limits the behaviour of reference types in \CFA polymorphic functions, where a type @T@ can bind to a reference or non-reference type. 124 125 \PAB{My analysis shows} without any restrictions, this ambiguity limits the behaviour of reference types in \CFA polymorphic functions, where a type @T@ can bind to a reference or non-reference type. 125 126 This ambiguity prevents the type system treating reference types the same way as other types, even if type variables could be bound to reference types. 126 127 The reason is that \CFA uses a common \emph{object trait}\label{p:objecttrait} (constructor, destructor and assignment operators) to handle passing dynamic concrete type arguments into polymorphic functions, and the reference types are handled differently in these contexts so they do not satisfy this common interface. … … 286 287 \end{figure} 287 288 288 The primary issues for tuples in the \CFA type system are polymorphism and conversions.289 \PAB{I identified} the primary issues for tuples in the \CFA type system are polymorphism and conversions. 289 290 Specifically, does it make sense to have a generic (polymorphic) tuple type, as is possible for a structure? 290 291 \begin{cfa} … … 384 385 Scala, like \CC, provides tuple types through a library using this structural expansion, \eg Scala provides tuple sizes 1 through 22 via hand-coded generic data-structures. 385 386 386 However, after experience gained building the \CFA runtime system, making tuple-types first-class seems to add little benefit.387 However, after experience gained building the \CFA runtime system, \PAB{I convinced them} making tuple-types first-class seems to add little benefit. 387 388 The main reason is that tuples usages are largely unstructured, 388 389 \begin{cfa} … … 571 572 572 573 Currently in \CFA, variadic polymorphic functions are the only place tuple types are used. 573 And because \CFA compiles polymorphic functions versus template expansion, many wrapper functions are generated to implement both user-defined generic-types and polymorphism with variadics.574 \PAB{My analysis showed} many wrapper functions are generated to implement both user-defined generic-types and polymorphism with variadics, because \CFA compiles polymorphic functions versus template expansion. 574 575 Fortunately, the only permitted operations on polymorphic function parameters are given by the list of assertion (trait) functions. 575 576 Nevertheless, this small set of functions eventually needs to be called with flattened tuple arguments. … … 821 822 822 823 In general, non-standard C features (@gcc@) do not need any special treatment, as they are directly passed through to the C compiler. 823 However, the Plan-9 semantics allow implicit conversions from the outer type to the inner type, which means the \CFA type resolver must take this information into account.824 However, \PAB{I found} the Plan-9 semantics allow implicit conversions from the outer type to the inner type, which means the \CFA type resolver must take this information into account. 824 825 Therefore, the \CFA resolver must implement the Plan-9 features and insert necessary type conversions into the translated code output. 825 826 In the current version of \CFA, this is the only kind of implicit type conversion other than the standard C arithmetic conversions.
Note:
See TracChangeset
for help on using the changeset viewer.