You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to start a discussion about how wasm and especially the Web Assembly System Interface (wasi) may be used to improve the capabilities deltachat. This is a huge topic, and especially wasi is quite young. Nonetheless I would like to see a discussion about this happening, so here we go. I'll propose some starting points, but in no way that is meant to limit the discussion to just these.
Making deltachat-core-rust cross platform from a single blob.
This is huge IMO. Currently it's not straight forward to get up running and playing with deltachat-core-rust's repl example. To do so, I have to setup a rust nightly toolchain, compile it (which on my fairly old laptop takes some 15+ minutes) and then I got a dynamically linked blob with all the issues related to dynamic linking. If I could simply download a .wasm file for the repl example and run it, that would be nicer.
Security.
I Hope so that the last sentence made you wonder whether I just download and run binary blobs randomly. I admit it, I do. However, If I do so with wasi stuff, I may feel a bit more encouraged, as wasi runtimes need to offer sandboxing, making it harder for malicious code to harm me without explicitly giving consent to file access.
Integration.
How would one use deltachat-core-rust as a library in python? Well there is bindings and modules for that, offering rich functionality once set up. However, using wasi, one would get all of that, almost for free, for almost any language! There already are bindings for Python, Java, JavaScript, Rust, etc. and more are to come. By using this technology, one binary blob may be offered as library for many languages.
Please share your thoughts on this!
The text was updated successfully, but these errors were encountered:
wucke13
changed the title
Consider Web Assembly (wasm) System Interface (wasi) and it's possibilites
Consider Web Assembly (wasm) System Interface (wasi) and it's possibilities
Dec 31, 2019
@wucke13 Have you tried compiling Delta Chat for wasm32-wasi runtime? If we can setup CI for it and ensure that it can be built it would be nice, but honestly I don't see where we can use it now. All the platforms use native versions of the library and switching to wasm VM will only make things slower. There is probably some use for it for bot writing, though.
If you want to try doing it, please try to compile it and open specific issues if something does not work or PR that adds CI if it does. We try to move general discussions to https://support.delta.chat/ so issues on GitHub only contain issues that someone is working on.
As stated in my issue: For letting people try out your example with the quite fancy repl without spending 20 minutes on compilation.
All the platforms use native versions of the library and switching to wasm VM will only make things slower
How is the status of static linking? I was not able to build statically (which likely is to blame on me).
How is the status of compiling on the stable channel?
Regarding compilation, I'll start a list of blockers here (may not be exhaustive):
Didn't follow in detail but I suggest to first try to get our rPGP dependency to work fully with WASM/wasi. This will also be useful by itself, as it would make rPGP available in Browsers and for webmail and other browser software. See #1198
I would like to start a discussion about how
wasm
and especially the Web Assembly System Interface (wasi
) may be used to improve the capabilities deltachat. This is a huge topic, and especiallywasi
is quite young. Nonetheless I would like to see a discussion about this happening, so here we go. I'll propose some starting points, but in no way that is meant to limit the discussion to just these.deltachat-core-rust
cross platform from a single blob.This is huge IMO. Currently it's not straight forward to get up running and playing with
deltachat-core-rust
's repl example. To do so, I have to setup a rust nightly toolchain, compile it (which on my fairly old laptop takes some 15+ minutes) and then I got a dynamically linked blob with all the issues related to dynamic linking. If I could simply download a.wasm
file for the repl example and run it, that would be nicer.I Hope so that the last sentence made you wonder whether I just download and run binary blobs randomly. I admit it, I do. However, If I do so with
wasi
stuff, I may feel a bit more encouraged, aswasi
runtimes need to offer sandboxing, making it harder for malicious code to harm me without explicitly giving consent to file access.How would one use
deltachat-core-rust
as a library in python? Well there is bindings and modules for that, offering rich functionality once set up. However, usingwasi
, one would get all of that, almost for free, for almost any language! There already are bindings for Python, Java, JavaScript, Rust, etc. and more are to come. By using this technology, one binary blob may be offered as library for many languages.Please share your thoughts on this!
The text was updated successfully, but these errors were encountered: