3 ms·
TypeScript says hi.
by erichocean 7y ago
TypeScript says hi.
- staticassertion 7y agoTypescript makes virtually no changes to JS syntax, except what's necessary to support types.
- erichocean 7y agoTypeScript classes, constructors and enums say hi. Talk about moving the goalposts...
- throwaway894345 7y agoNo one is moving the goalposts. TypeScript's raison d'etre is to add static typing to JS. Reason's is to fix the syntax. (Yes, TS adds new grammatical constructs, but grammatical constructs are about grammar, not syntax, contra Reason).
- staticassertion 7y agoMaybe I just don't have enough experience, but I use classes in Javascript and TypeScript, as well as constructors, and they look virtually identical to me. What am I missing here?
- throwaway894345 7y agoTypeScript extends the syntax to support type annotations; it's not trying to fundamentally fix JS syntax.
- erichocean 7y agoNow enforcing type safety isn't a fundamental part of a language? I get the impression that you'd dismiss Rust as "basically C". ¯\_(ツ)_/¯
- thedufer 7y agoIt is, that's the point. Reason is, as was said upthread, a "veneer". It changes the syntax only, nothing else is different (you can convert back and forth between the syntaxes losslessly). TypeScript makes deep changes to the language by adding type safety.
- throwaway894345 7y agoI have no idea how you got that from my post. I don’t know whether type safety is “a fundamental part of a language” or not, but that’s irrelevant to my point. TS extends the JS syntax to support type safety. Reason changes OCaml’s syntax altogether because it’s broken. Big difference.