Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TypeScript says hi.


Typescript makes virtually no changes to JS syntax, except what's necessary to support types.


TypeScript classes, constructors and enums say hi.

Talk about moving the goalposts...


No 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).


Maybe 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?


TypeScript extends the syntax to support type annotations; it's not trying to fundamentally fix JS syntax.


Now enforcing type safety isn't a fundamental part of a language? I get the impression that you'd dismiss Rust as "basically C".

    ¯\_(ツ)_/¯


It 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.


I 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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: