stupid question: why doesnt google chrome support native typescript execution on their chromium engine?
Different projects use different versions of typescript with different configurations, and almost no one wants the client to throw type errors where the untyped code would have actually worked. I.e. the are drawbacks but no advantages. This is ongoing standardisation work to allow it to _ignore_ typescript and just run the JavaScript which will be nice but not a huge win.
It's not a stupid question, but here is the TC39 proposal to add type declarations to JS: https://github.com/tc39/proposal-type-annotations
Because TypeScript is a (legacy) mess.
There's effort towards "erasable syntax" but in practice not many really want to run anything more than basic TS in the browser, simply because you lose things like 'import _ from "lodash", which requires further setup (import maps) or is impractical in larger projects.
The real reason however is that TS is just a language, not part of any standard, and browsers are not just going to support random languages headed by corporations (Microsoft) and that are not community projects.
I'm not enough of an expert in PL theory and compilers to say for sure, but I suspect that because Typescript's syntax and semantics are all designed with total type erasure in mind, there's no advantage you could get to executing it natively versus compiling to JavaScript and taking advantage of all the optimizations JS engines already have.
"Native typescript execution" can mean two different things:
1. Chrome/v8 takes TS code, compiles it down to JS internally, erases types, and then runs it like normal. This isn't going to be too hard to do, but also isn't going to be very meaningful. Compiling is a one-step process in any case, and plenty of tooling exists to make it seamless.
2. Chrome/v8 actually understands TS types at runtime, and throws exceptions for mismatches. This isn't going to be possible without a major rewrite of the v8 engine and the ECMAScript spec itself.
And a big challenge for both of these is that TypeScript is iterating at too fast a pace for something like Chrome to keep up. It's best to just leave versioning and compilation for the developer to manage and give end users a consistent JavaScript experience.