5 ms·
someone explain to me the point of backend webassembly for a web framework? you're running the compiler already, why not emit... actual assembly
by efficax 4y ago
someone explain to me the point of backend webassembly for a web framework? you're running the compiler already, why not emit... actual assembly
- CleverLikeAnOx 4y agoCould be to allow running untrusted backend code. E.g., so kind of third-party extensions system for your product. Webassembly is good for sandboxing.
- pjmlp 4y agoYeah, who needs processes and OS security configurations when there is WebAssembly. /s
- dathinab 4y ago- Sandboxing of each request (is performant when the right kinds of snapshot+CoW technique is used) - PaaS for running WASM compiled untrusted web applications, especially nice for "edge service style PaaS" - Node style async of rust, can be a bit more simple then rust-async (but also likely more limited) - Similar "compile once run everywhere" as JVM (but better due to limited interface and server focused?), i.e. you have the wasm runner compiled for each target but you need to compile the program only once and then you can run it on all kinds of platforms including x86_64, arm64 etc. Especially good for PaaS but also good for more flexible deployment pipelines in large companies. And especially for many web use-cases, especially as run on a lot of "edge" services the drawbacks of single threaded WASM do not matter much. E.g. the workloads are of the kind which tend to work very well with WASM performance wise.
- quotemstr 4y ago> someone explain to me the point of backend webassembly for a web framework? you're running the compiler already, why not emit... actual assembly Once you're in this industry, you stop trying to figure out why fads come and go. There really isn't any reason. It's all fashion. You'll go crazy asking "Why?".
- wyldfire 4y agoI think it's similar to the whole javascript/node concept. In many ways, web development is like a single distributed application between client and server. So if you write your client code in Rust/Zig/C++/etc and emit wasm, wouldn't it be cool if you could share data structures and logic for that code on the backend that would handle client requests?
- kevincox 4y agoBut you can share code between Rust compiled to wasm on the frontend and rust compiled to native on the backend. In fact I did this for a game where you can either play locally on the frontend or play networked with optimistic updates provided by the client-side but the rules enforced on the server-side.
- pjmlp 4y ago