Closed michaeljota closed 6 years ago
My original spec had something like this with "use stricter" with the goal of changing the meaning of the language. Then I stumbled upon: https://esdiscuss.org/topic/removal-of-language-features#content-51
It made me reevaluate trying to change semantics and instead just stick to making additions to the language.
As for applying types the spec has the ":=" typed assignment operator.
let num := 0;
// num = `hello`; // would result in a type error
Yes, it's verbose, but it's staying with the idea of not adding new modes. I can almost guarantee you I could not find a champion that would support introducing such a large mode to the language.
Per your proposal, when using types, you need to the navigator both, the type and the value. Although, I have to say I like the sintaxis, this may add a lot of boilerplate at the end. Using a special string in the beginning of the file, of the function, could tell the browser to implicitly assign the same type of the first value.