4 ms·
Say you have `shared_library.so` which exposes methods/APS `foo()` and `bar()` How would you load them/link against them + call them in Webassembly land?
by MuffinFlavored 7y ago
Say you have `shared_library.so` which exposes methods/APS `foo()` and `bar()`
How would you load them/link against them + call them in Webassembly land?
- deleted 7y ago[deleted]
- pjmlp 7y agoBy using dynamic loading capabilities of WebAssembly runtimes. Watch Lin Clark's closing keynote at RustConf 2019. https://www.youtube.com/watch?v=VlIydW5Fojw https://www.youtube.com/watch?v=VlIydW5Fojw
- MuffinFlavored 7y agoDoesn't it kind of stink that there are so many WebAssembly runtimes? Fragmentation, different ways of doing things, etc.
- kbenson 7y agoNo? Would you prefer there was just one? That might make some things better, but it would make a great many things much worse, and make it much harder to fix them. Ideally we'll get to a few very good ones that are alle considered acceptable for most things that will steal good ideas from each other and experiment to find interesting ways forward. Nobody except their controlling entities really benefited in the long run from having IE as the vastly dominant browser, and I doubt we'll benefit from Chrome's emerging dominance to the same degree. IMHO, the compiler market was greatly benefited by the emergence of Clang as well. Competition is good.
- krapp 7y agoNo, this is what freedom and innovation looks like. Javascript has become mostly a lost cause as far as open source development goes, as it's basically owned and controlled by NPM Inc and corporate interests now, but WebAssembly at least still has the possibility of remaining open. At the very least, we should go through a period of experimentation by the community to settle on the best possible solutions (or sets of solution) and let things mature a bit, first. Now is not the time to bless a single runtime, package manager, etc.
- pjmlp 7y agoWebAssembly is developed by the same corporations that own JavaScript.
- krapp 7y agoThey don't own the runtime and package manager, though. Although Wasmer does come with a package manager (WAPM) that uses a proprietary registry like NPM, at least the developers have said they're committed to decentralized hosting[0]. Maybe someone can come up with a completely distributed package management alternative, which I would prefer, but at least Webassembly isn't yet at the degree of centralization that Javascript is. [0]https://news.ycombinator.com/item?id=19732794 https://news.ycombinator.com/item?id=19732794
- pjmlp 7y agoWhich are utterly meaningless with the specification developed by said corporations. And really, the only thing going for WebAssembly is being the PNaCL that those corporations were willing to agree on.
- krapp 7y agoIt's not the best possible scenario but "utterly meaningless" is hyperbole. Certainly it's better not to have every aspect of a language be centralized. It's already near impossible to distribute Javascript, or even software in many languages, without going through NPM. WebAssembly, thankfully, isn't there yet.
- pjmlp 7y agoIt surely is meaningless, because whatever your favourite WebAssembly implementation is capable of, ultimately it only matters if it is spec compliant. A spec, which is under control of those organisations.
- 7y ago
- coolspot 7y agoIn my experience you will still have to compile your .so as wasm with exported methods.