Post 9kXsTCdHVPdByyi8BM by Pervertor@mastodon.social
 (DIR) More posts by Pervertor@mastodon.social
 (DIR) Post #9kXj4v1oPK4oqWWxCi by espectalll@mstdn.io
       2019-07-05T14:59:42Z
       
       0 likes, 0 repeats
       
       Back to trying to make a WebAssembly server :blobcatsip:
       
 (DIR) Post #9kXlm9IzOwIjUCJ4Pw by espectalll@mstdn.io
       2019-07-05T15:29:56Z
       
       0 likes, 0 repeats
       
       Do I *really* have to go with Emscripten if I want to run a web server? Is it so early for WASI support?
       
 (DIR) Post #9kXmQKUpDGsRmG0CCe by espectalll@mstdn.io
       2019-07-05T15:37:11Z
       
       0 likes, 0 repeats
       
       wha-
       
 (DIR) Post #9kXnDBEwPqwzG8rmTY by espectalll@mstdn.io
       2019-07-05T15:46:00Z
       
       0 likes, 0 repeats
       
       installed with emsdk, Rust does the compiling thing now... except hng https://users.rust-lang.org/t/using-stdweb-emscripten-webassembly-and-futures-tokio-together/14772
       
 (DIR) Post #9kXnHMifg3co1LlgH2 by espectalll@mstdn.io
       2019-07-05T15:46:47Z
       
       0 likes, 0 repeats
       
       I'm getting tired of this a lot, how do people manage to write WASM backends?
       
 (DIR) Post #9kXpbjgiBtaKxKh0Qi by espectalll@mstdn.io
       2019-07-05T16:12:52Z
       
       0 likes, 0 repeats
       
       Alright, I guess people don't write WASM backends in Rust?
       
 (DIR) Post #9kXqbhC3Z5ufAptm3E by espectalll@mstdn.io
       2019-07-05T16:24:03Z
       
       0 likes, 0 repeats
       
       There's been... a surprisingly small amount of work on WASI support in Rust, apparently https://github.com/rust-lang/rust/commits/master/src/libstd/sys/wasi/sys/wasiI certainly can't see networking support in there
       
 (DIR) Post #9kXql6z92caTluLi0O by hirnbrot@mstdn.io
       2019-07-05T16:25:45Z
       
       0 likes, 0 repeats
       
       @espectalll You know, I always hated apt's phrasing here.This is a conflict - libstdc++6 and emscripten 1.22.1-1 don't work together (it says "Breaks:" *not* "Depends:").But I'm not even sure if the breakage is a "conflict" entry in libstd or in emscripten?
       
 (DIR) Post #9kXqrHAi54of6OhL4C by espectalll@mstdn.io
       2019-07-05T16:26:53Z
       
       0 likes, 0 repeats
       
       ur mom unsupported() https://github.com/rust-lang/rust/blob/00859e3e653973120006aaf3227823062dde1ba7/src/libstd/sys/wasi/net.rs
       
 (DIR) Post #9kXsIsy3lRyW65VgiO by espectalll@mstdn.io
       2019-07-05T16:43:04Z
       
       0 likes, 0 repeats
       
       It really is too early to use WebAssembly for servers, unless you don't mind going with Emscripten or WASI on C I guess (and yeah, you can use C and sockets: https://github.com/CraneStation/wasi-libc/tree/master/libc-bottom-half/cloudlibc/src/libc/sys/socket)
       
 (DIR) Post #9kXsTCdHVPdByyi8BM by Pervertor@mastodon.social
       2019-07-05T16:44:57Z
       
       0 likes, 0 repeats
       
       @espectalll yeeeah, C
       
 (DIR) Post #9kXsk6A6of00pz7dD6 by freakazoid@retro.social
       2019-07-05T16:48:00Z
       
       0 likes, 0 repeats
       
       @espectalll Waaaay too early for anything production. Toys/experiments, go for it!
       
 (DIR) Post #9kXsqS2yMTOmRwoUmu by espectalll@mstdn.io
       2019-07-05T16:49:08Z
       
       0 likes, 0 repeats
       
       @freakazoid I actually asked a friend who has been working with WASM since 2015 and seems pretty happy about it, told me it IS production-ready :blobpopcorn:
       
 (DIR) Post #9kXsvRn4k4sZ6PlB32 by espectalll@mstdn.io
       2019-07-05T16:50:02Z
       
       0 likes, 0 repeats
       
       @freakazoid (hey, everything works in browsers at least, it's just that you need to go through JS)
       
 (DIR) Post #9kXt4k3eC6NsMbwXqa by freakazoid@retro.social
       2019-07-05T16:51:44Z
       
       0 likes, 0 repeats
       
       @espectalll WASM in browsers, sure. Any server-side stuff is going to involve bespoke APIs that will probably be broken, not to mention probably nowhere near the sandboxing a browser has.
       
 (DIR) Post #9kXttdZe3pcp1UB9FI by espectalll@mstdn.io
       2019-07-05T17:00:55Z
       
       0 likes, 0 repeats
       
       @freakazoid I doubt the sandboxing is considerably weaker, considering an usual WASM runtime is Rust-based and manages resources using capabilities, and the architecture is as simple and secure from a host level as it gets (it can only access its own memory region). But what's the point if there's not much to do on it yet.
       
 (DIR) Post #9kXu3zPvhdJpfGZSEa by freakazoid@retro.social
       2019-07-05T17:02:48Z
       
       0 likes, 0 repeats
       
       @espectalll A fast WASM runtime is going to involve unsafe code. And Rust itself can have bugs. Any time you're doing something super complex with untrusted input, your process should be sandboxed.
       
 (DIR) Post #9kXu4RkSMuNLX2OF7I by espectalll@mstdn.io
       2019-07-05T17:02:51Z
       
       0 likes, 0 repeats
       
       @freakazoid here's a relevant post on the architecture design's security https://00f.net/2018/11/25/webassembly-doesnt-make-unsafe-languages-safe/
       
 (DIR) Post #9kXu8pbfbcxsgYN4BU by espectalll@mstdn.io
       2019-07-05T17:03:40Z
       
       0 likes, 0 repeats
       
       @freakazoid Sandboxing a process just means managing permissions with something else. Depends on what you trust and what/how it's exposing.
       
 (DIR) Post #9kXuHaaMp5Z0hkwC2a by freakazoid@retro.social
       2019-07-05T17:04:57Z
       
       0 likes, 0 repeats
       
       @espectalll That's just part of it. The other part is taking away ambient privileges through chroot, namespacing, limiting allowed system calls, cgroups, etc.
       
 (DIR) Post #9kXuPvDC1FDczb4UCG by espectalll@mstdn.io
       2019-07-05T17:06:46Z
       
       0 likes, 0 repeats
       
       @freakazoid Those are part of the permissions I implied. If you don't trust the WASM runtime enough, it makes sense.
       
 (DIR) Post #9kXuSNoKexF6GncIBk by espectalll@mstdn.io
       2019-07-05T17:07:12Z
       
       0 likes, 0 repeats
       
       @freakazoid (also most of those take like no resources)
       
 (DIR) Post #9kXub6S2ZTrd2KLd3I by freakazoid@retro.social
       2019-07-05T17:08:47Z
       
       0 likes, 0 repeats
       
       @espectalll You should never trust anything more than you need to.