News for hackers. Stuff that matters.
Re:Rust is a hard way to make a web API by hda2 on Friday January 15, 2021 @10:54PM (#25799881)
Pardon my ignorance, but how are you using .wasm in the browser? How are getting values out of the web assembly module?
Re:Rust is a hard way to make a web API by smolder on Friday January 15, 2021 @11:31PM (#25800057)
I used wasm bindgen to make rust code callable from js. https://rustwasm.github.io/docs/wasm-bindgen/
Re:Rust is a hard way to make a web API by ctr_ctr on Friday January 15, 2021 @11:29PM (#25800051)
Re:Rust is a hard way to make a web API by jagged-chisel on Friday January 15, 2021 @11:22PM (#25800011)
JavaScript is used to fetch, initialize, and run the wasm module. As long as the module exports functions, they can be called from JS. There are JS libraries that will automatically setup up bindings for you.