3 ms·
Does anyone who is familiar with WebAssembly development know what kinds of things Dynamic Linking (mentioned among the future features) will enable? For insta
by legutierr 11y ago
Does anyone who is familiar with WebAssembly development know what kinds of things Dynamic Linking (mentioned among the future features) will enable? For instance, would it permit the creation of optimized WebAssembly libraries written in C++ that could be called by a JavasSript program (say, for things like image processing)? Would it eventually permit library sharing between, say, a Python runtime compiled to WebAsembly and JavaScript in the browser?
Because that would pretty cool.
- tyingq 11y ago>>Would it eventually permit library sharing between, say, a Python runtime compiled to WebAsembly and JavaScript in the browser? The hard part there is the "eventually". They do state that the missing pieces will come some time after the "Minimum Viable Product", but none of it sounds high priority. - The current course omits features that would be needed for any dynamically typed language (including Python) to work. (garbage collectors, polymorphic inline cache, etc) - The current course also prevents anything running in the WebAssembly space from accessing the DOM. You can call your WebAssembly from javascript, but that's it. I suspect it will be quite a while before there's more available than "call LLVM created libraries from javascript". Technically, you could, I suppose put the entire cpython codebase into webassembly, but that seems like more of parlor trick than something useful.
- titzer 11y agoYou can already do some of that without the dynamic linking feature. There is a JS API to instantiate a WebAssembly module, providing JS functions that are callable as external functions from within the WASM module. Conversely the WASM module exports functions that are callable directly from JS. This allows rudimentary interop between JS and WASM, and dynamic linking will make it possible to deliver your WASM application in separate pieces, e.g. a large, rarely-changing library that is cached, precompiled, by the browser, and a small, often-changing application piece.