4 ms·
WebAssemply Hello World
- ygra 10y agoHow is interop with native JS in WebAssembly performance-wise? If I switch between WASM and JS every few instructions, will that incur some sort of context switch? (I recall Firefox having such issues in asm.js where calls from asm.js into native JS were quite costly.)
- auggierose 10y agoWASM has been designed such that these calls can be made in principle very cheaply. I don't know though how much current engines have been optimised for that use case though.
- infogulch 10y agoHow likely is it for all the JS api surface to be exposed to WASM code directly -- no js required?
- auggierose 10y agoI guess pretty unlikely as WASM has been designed to be a generic engine which is embeddable in other contexts than Javascript as well. You can already import JS functions into WASM code, I guess the biggest hurdle for JS interop is that WASM only knows about ints and floats, but not arbitrary JS objects.
- auggierose 10y agoThis paper is great for understanding WASM in depth: https://github.com/WebAssembly/spec/blob/master/papers/pldi2017.pdf https://github.com/WebAssembly/spec/blob/master/papers/pldi2...
- bassman9000 10y ago> The main storage of a WebAssembly program is a large array of bytes referred to as a linear memory or simply memory. > Growing may fail with an out-of-memory condition indicated by grow memory returning −1 to be handled by the program. Back to the basics :)
- brickmort 10y agosame as it ever was
- michaelmior 10y agoCan mods fix the typo in the title?