logoalt Hacker News

warpechyesterday at 7:00 PM2 repliesview on HN

Compiling TypeScript is just stripping out types


Replies

gleennyesterday at 10:15 PM

Isn't that like saying the Internet is only written in English if you strip out all the non-English. All C-style languages are fully cross compatible if you only use semicolons.

I can't write Typescript into a browser without cross-compilation and "stripping out types" involves parsing and manipulating code. That's a different language.

Stratoscopeyesterday at 7:38 PM

That is true only if you confine your TS code to be pure JS plus type annotations.

There are TS constructs that require compilation into equivalent JS, such as enums and namespaces.

show 3 replies