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

**URL:** <https://forum.dfinity.org/t/if-not-feasible-to-implement-a-functionality-in-motoko-is-it-possible-to-create-a-motoko-interface-able-to-call-an-existing-library/11569>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [March 18, 2022, 7:06am UTC](https://forum.dfinity.org/t/if-not-feasible-to-implement-a-functionality-in-motoko-is-it-possible-to-create-a-motoko-interface-able-to-call-an-existing-library/11569 "2022-03-18T07:06:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ildefons](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ildefons/32/2638_2.png) [@ildefons](https://forum.dfinity.org/u/ildefons)\
**Post date:** [March 19, 2022, 8:20am UTC](https://forum.dfinity.org/t/if-not-feasible-to-implement-a-functionality-in-motoko-is-it-possible-to-create-a-motoko-interface-able-to-call-an-existing-library/11569/3 "2022-03-19T08:20:28Z")

</div>

@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:

> [@Why is Rust more used than Motoko](https://forum.dfinity.org/t/why-is-rust-more-used-than-motoko/11503/2):
>
> Rust has a bunch of existing libraries that can be leveraged as long as you are doing only small bits of work in your contract.

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

---

_[View the full topic](https://forum.dfinity.org/t/if-not-feasible-to-implement-a-functionality-in-motoko-is-it-possible-to-create-a-motoko-interface-able-to-call-an-existing-library/11569)._
