rudof-project / rudof

RDF data shapes implementation in Rust
https://rudof-project.github.io
Apache License 2.0
39 stars 3 forks source link

Make a version of the library compatible with WebAssembly #49

Open labra opened 5 months ago

labra commented 5 months ago

We would like to have the core part of the ShEx and SHACL validators and parsers compatible with WebAssembly so we could have standalone demos developed as WebAssembly.

Looking at this book, it seems that we need to remove some I/O parts from the core library.

We may need to check which modules can be compiled to WebAssembly:

Following is a list of libraries that we depend on and that we require to be compatible with WebAssembly:

vemonet commented 2 weeks ago

Being able to compile to WebAssembly would be a really nice feature as it is becoming more and more the "standard binary format of the web"

This way you could serve rudof as a simple npm package, that could be used from client and server-side JS, so rudof could be used directly through the browser in a simple .html file statically served! Or on the server with NodeJS/deno (becoming more and more used in web dev)

We did it for the nanopub rust library, we have 1 core lib + 1 CLI + 1 python + 1 npm, it is much simpler thnt rudof in term of dependency tree, but we also needed to do some runtime related things + send HTTP requests with reqwest: https://github.com/vemonet/nanopub-rs

What we learned was that:

Example use of non-blocking reqwest in our core lib: https://github.com/vemonet/nanopub-rs/blob/main/lib/src/network.rs#L26