Browsers won't enforce the types (which seems to be a non-goal) but build systems and package managers could. Debuggers could warn about type errors when you're using them, maybe?
Why would you add a type system to the language and then not use it?
You just advocated for developers using tool to validate the types, but that already exists in the form of typescript.
Warnings also don’t matter, as live sites don’t report debugger warning to the host servers (and even if they did they’re unlikely to be fixed).
The only reason to add the type syntax to js is if that type system is going to be enforced.
We don’t want another series of wat presentations about the bizarre JS type system, and we don’t want to add things to the language if there isn’t value in doing so.
The types are for end users insofar as they help ensure that the site operates correctly. Them not being enforced means that you also can’t be notified (through window.on error or whatever it is) that your site has a type bug in it.
Any type syntax added to the JS language must be able to pay for itself, and making it so you can paste some subset of typescript into the JS console is nowhere near justification.
You just advocated for developers using tool to validate the types, but that already exists in the form of typescript.
Warnings also don’t matter, as live sites don’t report debugger warning to the host servers (and even if they did they’re unlikely to be fixed).
The only reason to add the type syntax to js is if that type system is going to be enforced.
We don’t want another series of wat presentations about the bizarre JS type system, and we don’t want to add things to the language if there isn’t value in doing so.
The types are for end users insofar as they help ensure that the site operates correctly. Them not being enforced means that you also can’t be notified (through window.on error or whatever it is) that your site has a type bug in it.
Any type syntax added to the JS language must be able to pay for itself, and making it so you can paste some subset of typescript into the JS console is nowhere near justification.