Hacker News new | past | comments | ask | show | jobs | submit login

Why would anyone do that?



I 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.


Because they want to run arbitrary code in a sandboxed environment with well defined interfaces.


You 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/

memory64 support will be very useful, because many non-trivial designs will use a lot more than 4GiB of RAM.


This article give some reasons for Cloudflare workers:

https://shivangsnewsletter.com/p/why-doesnt-cloudflare-use-c...


Sandboxed environment as an alternative to virtual machine or docker container




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: