3 ms·
It's difficult or impossible to compile many languages into JavaScript. WASM is more general.
by winternewt 2y ago
It's difficult or impossible to compile many languages into JavaScript. WASM is more general.
- TekMol 2y agoTheoretically or because of the tooling landscape?
- swiftcoder 2y agoDo you have a source for this? asm.js (the spiritual precursor to WASM) worked pretty much the same, and an awful lot of languages were compiled to it. WASM does provide a more predictable compilation target to be sure, but I don't think it actually opens any new possibilities re what languages can be compiled.
- winternewt 2y agoMultithreading and 64-bit integers come to mind as creating difficulty, and I imagine "raw" memory buffer access having much higher latency to the point where it's completely impractical. For example, a quick search gave me this library [1] that compiles FFMpeg into Asm.js but the author says it is almost a factor 10 slower. Asm.js would also become extremely verbose for any larger code base (imagine compiling a AAA PC game to Asm.js). It may be as you say that there are no new theoretical possibilities being opened by WASM, but to me it is a natural step forward to resolve inefficiencies and ergonomic problems in ASM.js and make it all less painful. And hopefully WASM won't be frozen in time either - the platform needs to keep improving to make more use-case scenarios practical. [1] https://github.com/Kagami/webm.js/ https://github.com/Kagami/webm.js/