News for hackers. Stuff that matters.
Re:TypeScript Is Surprisingly OK for Compilers by flohofwoe on Friday August 18, 2023 @05:27AM (#37173198)
Any non-toy WASM application running in browsers will almost certainly end up as a hybrid WASM/JS application, just because you can't call directly from WASM into browser APIs, and even if the JS shim is "hidden from view", sometimes it's either more convenient or even more performant to write more than just a thin API shim in Javascript, especially for asynchronous code or to avoid redundant copying of large data blobs in and out of the WASM heap.
Re:TypeScript Is Surprisingly OK for Compilers by LudwigNagasena on Friday August 18, 2023 @06:06AM (#37173541)
> just because you can't call directly from WASM into browser APIs

Surely that will change someday.

Re:TypeScript Is Surprisingly OK for Compilers by flohofwoe on Friday August 18, 2023 @06:23AM (#37173673)
You are still limited by the fact that browser APIs are mainly designed for usage with Javascript, and those Javascript APIs usually don't map all that well to languages used with WASM (which typically use the "C ABI" for FFI). There is zero chance that each web API will get a second API which is compatible with "C calling conventions".

There is a (now inactive) "interface-types" proposal, which has dissolved into "component-types", but this scope-creep definitely is already quite concerning:

https://github.com/WebAssembly/interface-types