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

It's really not. YAML is a superset of JSON, but you wouldn't call a YAML document a JSON document. The set of all colors is a superset of the set containing only orange, but calling every color orange makes no sense.


I don't think it's exactly right to call it a superset either..

It adds types and constraints that have no effect on the resulting transpiled code besides an insurance that said type constraints are being met.

To better illustrate what I mean, in the start of a Unix script you sometimes have them augmented with #!interpreter. But this extra contextual information is not a superset of the scripting language itself. Likewise Typescript is also an augmentation that lives within the code that provides contextual information to the Typescript transpiler itself, but does not necessarily effect the actuall produced JavaScript.


I see your point and not necessarily disagreeing, but noting the creators of typescript refer to it as a superset.


All colours don't boil down to "orange" in Human eyes, so calling all colours orange really would be pointless. Typescript does compile down to JS, without which it can't even run. So yeah, when you're talking about the runtime or performance, Typescript === Javascript.


> Typescript does compile down to JS, without which it can't even run. So yeah, when you're talking about the runtime or performance, Typescript === Javascript.

By this kind of logic, C++ === machine code. It compiles down to it, right?


It's really kinda both, but context sensitive.




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

Search: