3 ms·
Why would anyone do that?
by eapriv 2y ago
Why would anyone do that?
- peutetre 2y agoBecause they want to run arbitrary code in a sandboxed environment with well defined interfaces.
- eknkc 2y agoI would, if the thing stabilized enough. For example, in a project needed to rely heavily on markdown and needed the exact same markdown renderer on both server and client. That alone made us choose node.js on the server side so that we could use the same markdown module. Today, I'd probably find a rust / c etc markdown renderer and compile it to wasm. Use it on the server and client as it. This is a silly example but wasm being a universal runtime would allow interfacing things a lot easier. Ah also, things like cloudflare workers let you run wasm binaries on their servers. You can write in in any language that can target wasm and you have a universal runtime. Neat.
- umvi 2y agoSandboxed environment as an alternative to virtual machine or docker container
- aseipp 2y agoYou can embed a C/C++ program into arbitrary places using WASM as a runtime, so if you have any C++ program you want to automate, you can "lift and shift" it into WASM and then wrap it in something like TypeScript. This is surprisingly useful. WASM also removes sources of non-determinism, which may enable you to do things like aggressive caching of programs that would normally be slightly non-deterministic (imagine a program that uses a HashMap internally before dumping its output). I use this to run FPGA synthesis and place-and-route tools portably, on all operating systems, with 100% deterministic output: https://yowasp.org/ https://yowasp.org/ memory64 support will be very useful, because many non-trivial designs will use a lot more than 4GiB of RAM.
- lenkite 2y agoThis article give some reasons for Cloudflare workers: https://shivangsnewsletter.com/p/why-doesnt-cloudflare-use-containers https://shivangsnewsletter.com/p/why-doesnt-cloudflare-use-c...