3 ms·
> 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.
by crabmusket 3y ago
> 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.
- erhaetherth 3y agoI 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.
- crabmusket 3y agoIf 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.