6 ms·
We don't support that yet, but we are working on it. It's not that easy even if the theory is kind of simple to explain. The implementation in the different bac
by Hywan 7y ago
We don't support that yet, but we are working on it. It's not that easy even if the theory is kind of simple to explain. The implementation in the different backends is mostly the challenge. The Python extension uses the Wasmer runtime (https://github.com/wasmerio/wasmer https://github.com/wasmerio/wasmer) which supports 3 backends to generate executable code: Singlepass, Cranelift, and LLVM.
Cranelift is the easiest one to embed, and it brings a great balance between compilation time and execution time. That's the one used in the Python extension right now.
The “import functions” feature is also missing in the PHP extension (https://github.com/wasmerio/php-ext-wasm https://github.com/wasmerio/php-ext-wasm), but yeah, as I said, we are working on it. It's coming soon!
- indentit 7y agounderstood, thanks for the explanation - keep up the great work! is there anything external contributors can do to help? :) I didn't find any issues labelled "good first issue" but I did find a related issue[0] [0]: https://github.com/wasmerio/wasmer/issues/267 https://github.com/wasmerio/wasmer/issues/267
- Hywan 7y agoThe best way to help right now is to test it, and report any issues! I've been able to try it on Windows so far for instance. Also the API isn't complete. We need to be able to grow the memory for instance. We need to understand the community needs to define a roadmap for the community itself.
- jononor 7y agoOnce you allow to call Python, keeping things sandboxed becomes pretty hard, doesn't it?
- Hywan 7y agoThat's true. However, it allows to integrate your Wasm program to your favorite framework more easily. It's likely to be a small surface of code to review carefully. It's always a balance :-).
- tracker1 7y agoIt's often for code that is asynchronous that will not return an answer immediately... the function passing is most often used to send a callback for these situations.
- jononor 7y agoA state-machine, generator or coroutine can be used instead of callbacks. I mostly prefer only having one direction of who-calls-who when combining multiple languages. Though I understand that for a general purpose system like Wasmer it makes sense to support everything, so that users can choose the architecture.