← Back to context

Comment by Curosinono

4 hours ago

I don't get it why the hell is TypeScript still not nativly supported in modern browsers?

Likely because everybody would still strip types, bundle and minify their typescript code anyway.

My gripe is why doesn't Webassembly fully support dom manipulation. If we got that working anyone could just bring any language to the browser and we would finally be free from the shackles of JS.

Because "it doesn't exist". It's just a layer on top of js, it doesn't have its own runtime, and btw what would supporting ts a the browser level mean? If you want to support a static typed language then you could just compile it down to wasm, if you just want to support types and ignore them at runtime there's an overhead price to pay, or should do runtime type checking? And with which tsconfig? Strict or not?

  • All good questions. But... it would simply eliminate a step and result in a single language.

    Python supports types and is interpreted, right?

There wouldn't be any benefit. It's not sound so it can't really be used to improve performance.

There was a proposal to support TypeScript syntax, but ignore the actual types (this is basically how Python works). That would be kind of nice because you can skip the compilation step completely (less faff for small projects), but I don't think it went anywhere... or if it is it's getting there at a snail's pace:

https://github.com/tc39/proposal-type-annotations