News for hackers. Stuff that matters.
Re:Is WebAssembly magic performance pixie dust? by paavohtl on Wednesday April 14, 2021 @06:03AM (#26804970)
Compiling TypeScript to JavaScript is essentially just removing the type annotations. Compiling to a bytecode VM would be orders of magnitude more work, especially since TS is defined to have exactly the same runtime semantics as JavaScript.
Re:Is WebAssembly magic performance pixie dust? by sesm on Wednesday April 14, 2021 @07:05AM (#26805431)
Unfortunately, it's not.

TS classes are not JS classes, TS has it's own implementation of async/await, etc. Just check any compiled TS code and you'll see it. It's very frustrating when you want to quickly patch a bug in 3rd-party library.

Re:Is WebAssembly magic performance pixie dust? by paavohtl on Wednesday April 14, 2021 @10:29AM (#26807555)
TS can target older versions of JS without modern features, just like Babel. If you target a more recent latest release of ES, the emitted JS should be pretty much the same as the source TS, just without type annotations.
Re:Is WebAssembly magic performance pixie dust? by sime2009 on Wednesday April 14, 2021 @08:00AM (#26805857)
You are most likely looking at code which has been compiled to target an older ES version which doesn't have these features.