Re: [heycam/webidl] BREAKING: Convert the `unrestricted` keyword into an extended attribute (#857)

For numeric types, I'm thinking about the following suggestion from Domenic.

> Another potential framework is to try to match some sort of consensus-type-system of C++/Rust, i.e. implementer languages.

1. Define numeric types based on its memory size.
int8, int16, int32, and int64 should be different types.
2. float32 and int32, float64 and int64 should be different types because it's very different how to interpret their bit patterns.
3. int32 and unsigned int32 should be different types because sign extension, equality comparison, etc. are different even if their bit patterns are the same.

It looks good/reasonable to me to put memory layout and bit pattern interpretation as key principles of the type system of primitive types.  I agree that [Restricted] looks more natural and consistent with others.  (We should choose a better name for [Restricted], though.  For example, [DisallowNanAndInf] looks clearer to me.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/857#issuecomment-604897461

Received on Friday, 27 March 2020 09:18:32 UTC