sirisian / ecmascript-types

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

I want this instead #80

Open jimmywarting opened 1 year ago

jimmywarting commented 1 year ago

proposal-type-annotations just reached stage 1. I do not like this at all. it don't give any befit to the browsers what so ever.

I like this proposal even better. to bad it haven't reached any stage yet... 😞 i fear that this optional type annotations will be in conflict with your proposal.

sirisian commented 1 year ago

Any proposal can get to Stage 1 with a TC39 member. This is why so many proposals sit at stage 1 for years and go nowhere.

The bigger issue going forward is getting all the TC39 members to agree to having runtime types.

i fear that this optional type annotations will be in conflict with your proposal.

Yes, the syntax would need to change in this proposal. It's the only proposal I don't currently take into consideration when making changes to support. With every other current proposal there's no conflicts.

I have hoped that Type Annotations would use :: syntax for their proposal in order to not conflict with this one. I haven't brought this up to them though. (Though others have mentioned it, so it seems they're aware this is an option).

jimmywarting commented 1 year ago

i feel like it would benefit the language more to have real type system, like as if you want to allocate a number that can only be a positive int16 for instance, it would allocate so much less memory if i could be more explicit about my types.

Heck it would maybe even be able to compile this to something more low level assembly code then.