Change terminology away from terms that are ambiguous:
Vector in Vector(T:! type). Don't use that term to refer to T, as it
would with #2360.let
bindings.Right now, the term "generic type" has two meanings. In this example:
class Vector(T:! type);
Both Vector and T could be called a "generic type." It would be much less
confusing if one of those two would have a different name.
Similarly, "constant" can currently mean multiple things:
let instead of varconst T*In practice, this has resulted in confusion. For example, the term "constant
bindings" doesn't include all let bindings, even though they are not variable
bindings.
The two meanings of "generic type" come from:
:! binding, such as in a generic
parameter or associated constant.Issue
#1391: New name for "constant" value phase
implemented in proposal
#2964: Expression phase terminology,
expanded the term "constant" from referring to just template constants to also
include symbolic constants from checked generics. Since then proposal
#2006: Values, variables, pointers, and references
introduced the const modifier on types, providing a read-only view.
We make these changes:
Vector in Vector(T:! type). Don't use that term to refer to T, as it
would with
#2360.let bindings.The following design documents have been updated in this proposal to reflect these changes:
Some of these changes have already been implemented in:
This proposal advances these goals of Carbon:
The main alternative considered was the status quo. This was discussed:
During those discussions, we also considered "symbolic type" instead of "generic
type". This did not work out, though, since it conflicted with the term
"symbolic" used as an expression phase. We considered other possibilities:
"figurative type", "computed type", "hole type", "open type", and "placeholder
type" (though that might be better applied to auto).
It also came up that we did not want to use the term "generic binding" to mean a compile-time binding, because that term would be better applied to a parameterized binding, see #naming on 2023-Jul-31. Those are not currently supported in Carbon, but are something we are likely to add. For example, Rust has generic associated types as of v1.65.