Hacker News new | past | comments | ask | show | jobs | submit login

> or is it also compiling down to JS and executing that?

This is the only way to execute TypeScript. That's how every tool that "executes" TypeScript works.




I don't buy it. That might be how every tool today works, but there's no reason V8 or whatever can't run TS the same way it runs JS.


If it runs TS "the same way" it runs JS then how is that different to what I described? It would be a JS engine that strips the types before execution.

There is a persistent fantastical hope that TS can somehow be a compiled language. It can't, not without breaking compatibility with JS. Until, of course, someone manages to compile JS - but at that point TS would be irrelevant.

I say this as someone who loves TS and wouldn't want to be without it: TS is a fancy linter. JS defines the execution semantics of the language.




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

Search: