Live data from Hacker News

Wasmer 5.0

wasmer.io

41–50 of 90 posts

Re: Wasmer 5.0

#41
post #33

Cool release! I've yet to personally find a good use case for wasm in any project, kind of the same way I'm not quite sure what to do with a bunch of Raspberry Pis It fills a need, I just don't know who/what has that need. Example: Say I write a bunch of Rust async projects for fun. Scraping APIs, etc. How/why would I choose wasm/wasmer to do that instead? I'd do it in Rust (awkwardly/in some specific non-standard wa…

I think the biggest company using wasm in production is figma (though there might be others). Otherwise, here is an example where wasm shines. Say you have an editor (rvim) and you want to support plugins. Usually, you’ll have a language interpreter and ask developers to develop in this language. With wasm, you can give them the freedom to use whatever stack they want. Then you expose an interface for their wasm arti…

> I think the biggest company using wasm in production is figma (though there might be others)

Amazon uses Rust to wasm for the Prime video app and Google uses Java to wasm for Google Sheets. Both get higher performance and lower memory usage versus JavaScript:

https://www.amazon.science/blog/how-prime-video-updates-its-...

https://web.dev/case-studies/google-sheets-wasmgc

Abode uses wasm in the web based version of Photoshop:

https://medium.com/@addyosmani/photoshop-is-now-on-the-web-3...

Re: Wasmer 5.0

#42

Cool release! I've yet to personally find a good use case for wasm in any project, kind of the same way I'm not quite sure what to do with a bunch of Raspberry Pis It fills a need, I just don't know who/what has that need. Example: Say I write a bunch of Rust async projects for fun. Scraping APIs, etc. How/why would I choose wasm/wasmer to do that instead? I'd do it in Rust (awkwardly/in some specific non-standard wa…

WASM has two primary usages: 1) Making canvas webapps with unblockable ads built-in 2) Downloading and running random blobs of other people's code in a sandbox

You can do both of those things in JavaScript.

WebAssembly brings every language to the web and does it with higher performance than JavaScript.

Re: Wasmer 5.0

#43
post #23

Interesting. I am happy with wasmtime though. Hacking on a wasm component model and wasi based plugin system these days. Having loads of fun. (I am aware of extism, but I am doing it for the fun :))

> Hacking on a wasm component model and wasi based plugin system these days. Same here! Can you share what you're working on? I'm (slowly) making a 3D CAD modeling API, so you write Rust code to define a model, and compile it to WASM so it can hot-reload and let you iterate faster. https://github.com/bschwind/opencascade-rs/tree/main/crates/...

shape.faces().farthest(Direction::PosZ)

nice. is this original from openscad (if that even is your inspiration)?

Re: Wasmer 5.0

#44

Cool release! I've yet to personally find a good use case for wasm in any project, kind of the same way I'm not quite sure what to do with a bunch of Raspberry Pis It fills a need, I just don't know who/what has that need. Example: Say I write a bunch of Rust async projects for fun. Scraping APIs, etc. How/why would I choose wasm/wasmer to do that instead? I'd do it in Rust (awkwardly/in some specific non-standard wa…

It probably makes sense if you're running untrusted code or handling untrusted data, or running code that was written after the rest of your app So for a solo dev it doesn't add much, but for a web browser or something that needs plugins it could make a lot of sense.

history tells us, that usecase will go out the window as soon as the usual suspects do their usual standards capture by implementation to support something or another related to advertising attribution.

Re: Wasmer 5.0

#45

Earlier quoted context omitted.

WASM has two primary usages: 1) Making canvas webapps with unblockable ads built-in 2) Downloading and running random blobs of other people's code in a sandbox

To be fair, a rock-solid sandbox with extremely well defined and host controlled ingress/egress in a tiny package sounds absolutely fantastic

that would have been implement in something like forward only language like ebpf. wasm is just an outgrown hack that people are hopping will be that safe sandbox and solve all JavaScript problems.

do not fool yourself with this temporary feature. wasm was first for js performance. secondly for portability. and third and accidentally for sandbox.

Re: Wasmer 5.0

#46

Would this allow to safely eval Node.js code in a sandbox?

Not "Node.js code" specifically as Node.js itself can't be compiled to wasm. JavaScript can be compiled to wasm, but that won't include the whole Node.js standard library and doesn't seem to be what you are asking.

Check out Deno for a sandbox that is getting there. Their new release does (aim to) support most Node.js code, where it previously and intentionally did not support node_modules nor CommonJS to the best of my knowledge.

If you care more about wasm than sandboxing in general, one project called javy is interesting, but you'll quickly notice they bring their own IO library and not much else in terms of something that compares to Node.js' API.

Re: Wasmer 5.0

#47

Cool release! I've yet to personally find a good use case for wasm in any project, kind of the same way I'm not quite sure what to do with a bunch of Raspberry Pis It fills a need, I just don't know who/what has that need. Example: Say I write a bunch of Rust async projects for fun. Scraping APIs, etc. How/why would I choose wasm/wasmer to do that instead? I'd do it in Rust (awkwardly/in some specific non-standard wa…

A toy project, but I'm working on a Scrabble clone for my mother to play. There's singleplayer against an AI, and then multiplayer against other people (myself, mostly). Multiplayer needs a server backend with all the game logic which I have programmed in Rust, but there's no reason I can't have the game logic for singleplayer running entirely in the browser. By compiling my backend code to WASM I basically do that -…

> Multiplayer needs a server backend

Did you mean single player? Although perhaps I'm just old and thinking about this in a strange way.

And can I clarify.. your scrabble app is web based already right? connecting to a rust web server for the game logic? And you want to embed that server by compiling to wasm? I probably should go read up on how this works.

Re: Wasmer 5.0

#49

Earlier quoted context omitted.

WASM has two primary usages: 1) Making canvas webapps with unblockable ads built-in 2) Downloading and running random blobs of other people's code in a sandbox

You can do both of those things in JavaScript. WebAssembly brings every language to the web and does it with higher performance than JavaScript.

For sandboxing in JS, we can use sandboxed iframes or webworkers. Both of those communicate to hosted code via postmessage which serializes an object and this can be used as a base for implementing function calls.

Whereas if I understand correctly, WASM can be provided with host approved JS functions to call directly in importObject. This seems more convenient and fast.

But for a plugin system, many people would prefer to write plugins in JS itself, so for WASM plugins, they might have to be compiled to WASM first. Dont know how if there is a mature implementation of JS->WASM.

Re: Wasmer 5.0

#50
These performance graphs are confusing and possibly cursed. Sometimes they're log scale (confusing enough) and others, I have no idea what they're trying to say.

For example, the first graph, labelled "Argon 2", nearly all the bars are the same length, labelled "100" (no units given, apparently log scale) and the individual bars are labelled with entirely different numbers in ms (presumably milliseconds).

Post reply on HN