Last year there was quite some interest on a topic about WASM and SAFE, and now I’m starting to read more and more about WASM and its possibilities. Also in the context of Rust and the SAFE Network. I’ve been thinking about some infrastructural, secure ways to use Rust and make it useful in NodeJS and the browser.
As Rust seems more robust and secure in comparison to the NodeJS/NPM ecosystem, Rust would be ideal to create core libraries. (Just like MaidSafe builds the core libraries in Rust and uses all sorts of bindings to make them useful in other languages.)
Let’s say a Rust library is written that communicates with the SAFE Network (with the Rust safe_app
dependency). Would there be a way to make use of that library within the SAFE Browser? The Rust library can be compiled to WASM, but the browser/JS is like a sandbox that blocks network calls and such. That renders the library useless. From Rust, JavaScript can be called, so in theory a Rust library could call the SAFE API in window.safe
, but that JS API is a very limited API in that it abstracts away a lot.
Would anything like the above be possible and feasible for the SAFE Browser? I saw some mention of something like this in @joshuef’s topic about the SAFE Browser last year:
WASM could be great (using built rust code directly in the browser would remove a layer of abstraction / unify the API interface; instead of having
safe-node-app
andwindow.safeXXX
interfaces which are inconsistent/ more things to maintain).
The future of WASM is promising, it opens more reliable libraries up to the web development world.