Re:Is WebAssembly magic performance pixie dust?
by FlyingSnake on Wednesday April 14, 2021 @03:01AM
(#26803872)
Can TS be compiled directly to WASM? I don't think WASM and JS are 1:1 compatible, but I'm out of my depth here.
[ Parent
| on HN ]
Re:Is WebAssembly magic performance pixie dust?
by Schampu on Wednesday April 14, 2021 @03:32AM
(#26804084)
AssemblyScript initially targeted TS->WASM compilation, by only supporting a strict subset of the TS language. But at some point they dropped that idea and defined their own TS-like language. I don't know the reason for this, but my guess is that TS is too dynamic to just directly compile it to WASM?
Re:Is WebAssembly magic performance pixie dust?
by pjmlp on Wednesday April 14, 2021 @06:10AM
(#26805020)
Microsoft has done exactly the same on their MakeCode IoT compiler, using TypeScript and Python.
"MakeCode Languages: Blocks, Static TypeScript and Static Python"
It is very hard to generate good AOT code when dealing with dynamic languages, of any kind.