Closed davidhalter closed 1 year ago
We already have ?Sized
and my assumption is it has to do with simplifying the parser. IMHO, it would make sense to be consistent with stuff already in the language.
To be honest, out of everything we're working on the syntax aspect of it is the part we're least set on. We should have done a better job at explaining this in our update, but we're mostly keen on getting something in the compiler we can start experimenting with, and start validating the semantics of our designs.
The reason why we chose ?keyword
over keyword?
is because, indeed, bounds such as ?Sized
already use that as their syntax. The way we envisioned it is that it would be possible for types to also declare negative bounds, where prefixing (!keyword
) makes a lot more sense than suffixing (keyword!
). We felt that would be the most consistent across the language.
I'm wondering why
?async
was chosen overasync?
. I'm sure you have good reasons for this, but I would like to understand them. Clearly there's already?Sized
, but apart from that I feel likeasync?
feels a bit more natural to me. Are there parser ambiguities withasync?
?I just personally would have gone with the other way around, but I doubt that it really matters in the end. Just the thoughts of an old Regex user :).
Thanks a lot for the hard work. Keep it up!