sirisian / ecmascript-types

ECMAScript Optional Static Typing Proposal http://sirisian.github.io/ecmascript-types/
453 stars 4 forks source link

typeof true is boolean, not bool #38

Closed WebReflection closed 6 years ago

WebReflection commented 6 years ago

please do not make same early mistake TypeScript did in its origins, in JavaScript, the primitive type for a boolean is booelan, not bool.

Thanks for considering this change.

WebReflection commented 6 years ago

to strength the reasoning about boolean VS bool

typeof 1 === 'number'
typeof '' === 'string'
typeof {} === 'object'
typeof Symbol() === 'symbol'

why would typeof false === 'bool' instead of its long time well known boolean type ?

Thanks for keeping this proposal consistent with the language.

sirisian commented 6 years ago

Updated the README file to change bool to boolean. Also updated the SIMD types proposed to use boolean for consistency. I'll keep this open until I transfer it to the spec file.

msadeqhe commented 5 years ago

to strength the reasoning about boolean VS bool

typeof 1 === 'number'
typeof '' === 'string'
typeof {} === 'object'
typeof Symbol() === 'symbol'

why would typeof false === 'bool' instead of its long time well known boolean type ?

Thanks for keeping this proposal consistent with the language.

What do you think about int8 type? should it be changed to integer8 too?

IMO, bool is a well known keyword to represent boolean type.

BTW, JavaScript has a Java in its name! and boolean belongs to Java world.

sirisian commented 5 years ago

The int and uint conventions are taken from Typed Arrays: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays

Javascript already has a lot of conventions. Trying not to change any of them as it could turn into a bikeshed issue and I'm trying to minimize those as much as possible.