Rust blas bindings that works on native + wasm32?

EDIT: I don’t want to manually add a *.js dependency to get blas. I want everything to be generated by cargo/rustc.

  1. No, I do NOT want to import an external *.js file to get BLAS bindings for Rust.

  2. I want a rust/blas crate where I can use it both natively, and in wasm32 with target=wasm32-unknown-emscripten.

  3. I do not want to include some external *.js for a pre-build blas; I really want something as simple as toggling the --target switch on cargo.

Thanks!

You inherently have to have a .js file, due to how WebAssembly works.

How should I rewrite the question? What I want to say is:

I don’t want to manually add a *.js dependency to get blas. I want everything to be generated by cargo/rustc.

I don’t know how to achieve this with bindings but, as an alternative, would a pure-Rust implementation of BLAS operations suit your needs ? The nalgebra crate is compatible with both native and WASM, and does implement some of the blas operations, and more can be added if needed.

1 Like

I would prefer to use blas because of it’s highly optimzied nature, but if blas/wasm32 fails, then yeah, pure rust impl seems the way to go.