If not feasible to implement a functionality in Motoko, is it possible to create a Motoko interface able to call an existing library?

@paulyoung, Thank you very much for the reply. I think that to expose a full LAPACK library as a canister is not a good approach in my case because the main motivation of creating a linear algebra in Motoko is precisely to simplify the development of machine learning libraries in Motoko, so having to run an additional canister just to use a Motoko library seems against the main purpose to simplify things.

I really think that to make Motoko a mainstream language to implement sophisticated contracts, it will be necessary a simple way to interface external libraries compiled in WASM.

By the time being, I have no more option that moving my project to Rust and using the many ML/AI libraries available in Rust.

@paulyoung @claudio, Can I use any Rust library if I develop my canister in Rust or are there any restrictions?
I’m asking because @skilesare says that:

I don’t understand what is exactly this limitation. Could you explain to what extend I can reuse Rust libraries?

1 Like