3 ms·
It's a format designed to be a target for static languages that do manual memory management (like C/C++) instead of JavaScript that some engines know how to rec
by johncolanduoni 9y ago
It's a format designed to be a target for static languages that do manual memory management (like C/C++) instead of JavaScript that some engines know how to recognize and optimize. The binaries are smaller and much faster to parse and the sandbox model results in much less overhead.
For a concrete example, at least two JavaScript engines (those of Chrome and Firefox) need to emit almost no range checks on regular memory accesses with WebAssembly on 64-bit computers. (For those interested in going past ELI5, they do this by allocating a large chunk of virtual address space, such that any out of range pointers will land somewhere in that space (WebAssembly currently only has 32-bit pointers). Some of the space is filled with memory, and the rest causes a controlled signal/exception so the engine can safely terminate the instance.)
- TekMol 9y agotarget for static languages that do manual memory management So I will have to do all the garbage collection myself? Isn't that a huge burdon on the programmer? And will this lead to lots of apps with memory leaks that needlessly eat up my resources?
- AgentME 9y agoThat's already the case if you want to do high-performance stuff with C/C++. WebAssembly is primarily about getting that into the web.