wasmer
wasmer copied to clipboard
Add support for MATLAB
MATLAB has loadlibrary feature that is capable of loading C libraries. It would amazing if a loadwasm extension could be created that allows loading a wasm library instead. It would be a lot easier to create and much more portable among the support MATLAB runtimes. It would give MATLAB authors access to a ton more data.
Hello :-),
Thanks for the suggestion! That's indeed a fun idea. Do you if the C API needs anything special to work with MATLAB?
We already provide a C API (https://github.com/wasmerio/wasmer/tree/master/lib/runtime-c-api) but I guess what you need, is WebAssembly exported functions as C functions, so that they can be called seamlessly from MATLAB, is that correct?
Can you provide me an example of an API you would like to use please?
It may make sense to make this one a commercially licensed option. MATLAB licenses are expensive. The current https://www.mathworks.com/pricing-licensing.html shows $860 USD for a Standard Edition Annual License. Unfortunately, I don't have access to MATLAB right now, so I'll be using Octave #540 for my course work. When I was working for a ML startup, I had access to MATLAB. An extension like this would be very useful for a ton of scenarios.
mex.h is a C API that allows you to dynamically get and call function. Googling just now, this slidedeck looks like a good overview.
About 3 years ago, I generated Rust bindings for mex.h, which you can see at https://github.com/ctaggart/mex-sys/blob/master/src/lib.rs. I put some example usage in https://github.com/ctaggart/mex-sys/issues/2, but actually got more than just that working.
Just like the go wasmer, it be awesome it could load "simple.wasm" and call the sum function.
That's a very interesting approach.
Since you already have some experience with MATLAB/Octave would you like to begin the project and perhaps we can help on the C API side? I would love to see support of Wasmer there as well! :)
@ctaggart Any news from your side?
PS: The new documentation for wasmer-c-api is here, https://docs.rs/wasmer-c-api/.
A lot has changed in the last two years. I'm no longer interested in this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Feel free to reopen the issue if it has been closed by mistake.