wasmer icon indicating copy to clipboard operation
wasmer copied to clipboard

Add support for MATLAB

Open ctaggart opened this issue 6 years ago • 5 comments

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.

ctaggart avatar Jul 09 '19 13:07 ctaggart

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?

Hywan avatar Jul 09 '19 14:07 Hywan

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.

ctaggart avatar Jul 09 '19 15:07 ctaggart

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! :)

syrusakbary avatar Jul 10 '19 23:07 syrusakbary

@ctaggart Any news from your side?

PS: The new documentation for wasmer-c-api is here, https://docs.rs/wasmer-c-api/.

Hywan avatar Jul 13 '21 15:07 Hywan

A lot has changed in the last two years. I'm no longer interested in this.

ctaggart avatar Jul 13 '21 16:07 ctaggart

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.

stale[bot] avatar Oct 20 '22 17:10 stale[bot]

Feel free to reopen the issue if it has been closed by mistake.

stale[bot] avatar Nov 19 '22 23:11 stale[bot]