Stream: wasm

Topic: never mind (ignore)


view this post on Zulip ender (Dec 30 2020 at 20:24):

"typically, this involves writing a new crate that depends on your target crate and wasm-bindgen, and uses wasm-bindgen to define an interface for working with the underlying crate"

How do you actually do this?

I took your advice and I'm trying to compile a different crate to WASM at this point. I thought that this code

use wasm_bindgen::prelude::*;
use easy_ml::matrices::Matrix;
#[wasm_bindgen]
pub fn column(v: Vec<isize>)  {
    Matrix::column(v);
}

would allow all the functionality of Matrix to be available to JS in the browser, but instead, only the single function that converts an array to a vector column was available in the browser. I'm sure this is due to my lack of understanding.

What would I do to make all of easy_ml available in the browser? I'm not understanding how this process actually works.


Last updated: Oct 23 2024 at 20:03 UTC